aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/CMakeLists.txt95
-rw-r--r--doc/ChangeLog77
-rw-r--r--doc/Makefile.am14
-rw-r--r--doc/Makefile.in14
-rw-r--r--doc/awkcard.in3
-rw-r--r--doc/gawk.125
-rw-r--r--doc/gawk.info1703
-rw-r--r--doc/gawk.texi399
-rw-r--r--doc/gawktexi.in399
9 files changed, 1919 insertions, 810 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 f2fa97bc..92e95a0b 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -10,6 +10,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.
@@ -66,6 +72,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>
@@ -74,6 +81,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>
@@ -103,7 +111,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>
@@ -125,12 +133,21 @@
* 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.
+
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.
@@ -162,6 +179,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.
@@ -175,6 +197,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.
@@ -188,6 +215,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>
@@ -229,10 +257,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.
@@ -328,6 +371,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.
@@ -361,6 +408,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.
@@ -375,6 +426,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
@@ -385,6 +448,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.
@@ -681,7 +749,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>
@@ -755,6 +823,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..68aacf48 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -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 ca28f0a7..556bdc1e 100644
--- a/doc/awkcard.in
+++ b/doc/awkcard.in
@@ -1609,6 +1609,9 @@ expand;
l lw(2i).
\*(CD\*(FCatan2(\*(FIy\*(FC, \*(FIx\*(FC)\*(FR The arctangent of \*(FIy/x\fP in radians.
\*(FCcos(\*(FIexpr\*(FC)\*(FR The cosine of \*(FIexpr\fP, which is in radians.
+\*(CB\*(FCdiv(\*(FIn\*(FR\*(FC,\*(FI d\*(FR\*(FC,\*(FI res\*(FR\*(FC)\*(FR T{
+Return the result of integer division in \*(FIres\*(FR.\*(CD
+T}
\*(FCexp(\*(FIexpr\*(FC)\*(FR The exponential function (\*(FIe \*(FC^ \*(FIx\*(FR).
\*(FCint(\*(FIexpr\*(FC)\*(FR Truncate to integer.
\*(FClog(\*(FIexpr\*(FC)\*(FR The natural logarithm function (base \*(FIe\^\*(FR).
diff --git a/doc/gawk.1 b/doc/gawk.1
index 0a37d5a8..3d5d1812 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -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
@@ -2629,6 +2635,23 @@ Return the cosine of
.IR expr ,
which is in radians.
.TP
+.BI div( 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 exp( expr )
The exponential function.
.TP
diff --git a/doc/gawk.info b/doc/gawk.info
index d6aea49f..3e12596d 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -246,6 +246,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
@@ -615,6 +616,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 +2642,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 +2943,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 +2985,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 +3014,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 +3060,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 +3451,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
@@ -6127,6 +6130,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 +7044,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 +7213,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.
-5.10 Summary
+ 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.11 Summary
============
* The `print' statement prints comma-separated expressions. Each
@@ -7233,11 +7296,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 +10400,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
@@ -11900,6 +11982,21 @@ brackets ([ ]):
`cos(X)'
Return the cosine of X, with X in radians.
+`div(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::).
+
`exp(X)'
Return the exponential of X (`e ^ X') or report an error if X is
out of range. The range of values X can have depends on your
@@ -19904,8 +20001,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/
@@ -19964,8 +20060,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
@@ -22445,6 +22557,62 @@ 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 `div()' function (*note Numeric Functions::).
+
+ You can simulate the `div()' function in standard `awk' using this
+user-defined function:
+
+ # div --- do integer division
+
+ function div(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
+`div()' 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
+ div(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
@@ -26386,6 +26554,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
@@ -26435,6 +26606,9 @@ the current version of `gawk'.
- The `bindtextdomain()', `dcgettext()', and `dcngettext()'
functions for internationalization (*note Programmer i18n::)
+ - The `div()' 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
@@ -26489,6 +26663,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
@@ -26874,6 +27053,28 @@ in POSIX `awk', in the order they were added to `gawk'.
* The dynamic extension interface was completely redone (*note
Dynamic Extensions::).
+ * 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 `div()' 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
@@ -27391,7 +27592,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
@@ -27433,17 +27636,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.
@@ -27474,11 +27683,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
--------------------------------------------
@@ -27534,9 +27744,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'
@@ -27580,7 +27824,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
@@ -31532,20 +31776,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)
@@ -31553,9 +31797,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)
@@ -31563,32 +31807,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)
@@ -31650,10 +31894,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.
@@ -31693,7 +31937,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)
@@ -31861,7 +32105,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)
@@ -31919,10 +32163,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.
@@ -31962,7 +32206,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)
@@ -32068,7 +32312,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)
@@ -32262,7 +32506,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)
@@ -32293,12 +32537,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 104)
* 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 328)
* dark corner, format-control characters: Control Letters. (line 18)
* dark corner, FS as null string: Single Character Fields.
(line 20)
@@ -32448,7 +32692,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)
@@ -32487,12 +32731,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 130)
* differences in awk and gawk, function arguments (gawk): Calling Built-in.
(line 16)
* differences in awk and gawk, getline command: Getline. (line 19)
@@ -32515,7 +32759,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 144)
* differences in awk and gawk, read timeouts: Read Timeout. (line 6)
* differences in awk and gawk, record separators: awk split records.
(line 125)
@@ -32525,7 +32769,7 @@ Index
(line 26)
* 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 279)
* differences in awk and gawk, single-character fields: Single Character Fields.
(line 6)
* differences in awk and gawk, split() function: String Functions.
@@ -32533,7 +32777,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 283)
* differences in awk and gawk, TEXTDOMAIN variable: User-modified.
(line 151)
* differences in awk and gawk, trunc-mod operation: Arithmetic Ops.
@@ -32549,6 +32793,7 @@ Index
* display debugger command: Viewing And Changing Data.
(line 8)
* display debugger options: Debugger Info. (line 57)
+* div: Numeric Functions. (line 18)
* division: Arithmetic Ops. (line 44)
* do-while statement: Do Statement. (line 6)
* do-while statement, use of regexps in: Regexp Usage. (line 19)
@@ -32569,12 +32814,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 149)
+* effective user ID of gawk user: Auto-set. (line 153)
* egrep utility <1>: Egrep Program. (line 6)
* egrep utility: Bracket Expressions. (line 26)
* egrep.awk program: Egrep Program. (line 54)
@@ -32629,13 +32874,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)
@@ -32668,10 +32913,10 @@ Index
* exit status, of VMS: VMS Running. (line 28)
* exit the debugger: Miscellaneous Debugger Commands.
(line 99)
-* exp: Numeric Functions. (line 18)
+* exp: Numeric Functions. (line 33)
* expand utility: Very Simple. (line 73)
* Expat XML parser library: gawkextlib. (line 35)
-* exponent: Numeric Functions. (line 18)
+* exponent: Numeric Functions. (line 33)
* expressions: Expressions. (line 6)
* expressions, as patterns: Expression Patterns. (line 6)
* expressions, assignment: Assignment Ops. (line 6)
@@ -32689,7 +32934,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 246)
* extension example: Extension Example. (line 6)
* extension registration: Registration Functions.
(line 6)
@@ -32770,7 +33015,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 104)
* FILENAME variable: Reading Files. (line 6)
* FILENAME variable, getline, setting with: Getline Notes. (line 19)
* filenames, assignments as: Ignoring Assigns. (line 6)
@@ -32838,9 +33083,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 114)
* FNR variable: Records. (line 6)
-* FNR variable, changing: Auto-set. (line 314)
+* FNR variable, changing: Auto-set. (line 328)
* for statement: For Statement. (line 6)
* for statement, looping over arrays: Scanning an Array. (line 20)
* fork() extension function: Extension Sample Fork.
@@ -32877,7 +33122,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.
@@ -32890,7 +33135,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 130)
* function calls: Function Calls. (line 6)
* function calls, indirect: Indirect Calls. (line 6)
* function calls, indirect, @-notation for: Indirect Calls. (line 47)
@@ -32939,8 +33184,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 221)
* gawk, ARGIND variable in: Other Arguments. (line 15)
* gawk, awk and <1>: This Manual. (line 14)
* gawk, awk and: Preface. (line 21)
@@ -32958,13 +33203,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)
@@ -32975,7 +33220,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 130)
* 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.
@@ -33007,7 +33252,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 144)
* gawk, regexp constants and: Using Constant Regexps.
(line 28)
* gawk, regular expressions, case sensitivity: Case-sensitivity.
@@ -33015,23 +33260,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 279)
* 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 283)
* 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)
@@ -33108,7 +33359,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 194)
* groups, information about: Group Functions. (line 6)
* gsub <1>: String Functions. (line 140)
* gsub: Using Constant Regexps.
@@ -33130,7 +33381,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)
@@ -33209,8 +33460,8 @@ Index
* installation, VMS: VMS Installation. (line 6)
* 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: Numeric Functions. (line 38)
+* INT signal (MS-Windows): Profiling. (line 213)
* integer array indices: Numeric Array Subscripts.
(line 31)
* integers, arbitrary precision: Arbitrary Precision Integers.
@@ -33266,7 +33517,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.
@@ -33338,7 +33589,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)
@@ -33354,14 +33605,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)
@@ -33402,8 +33653,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 235)
* McIlroy, Doug: Glossary. (line 258)
* McPhee, Patrick: Contributors. (line 100)
* message object files: Explaining gettext. (line 42)
@@ -33415,8 +33666,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 supported by MPFR library: Auto-set. (line 224)
+* metacharacters, escape sequences for: Escape Sequences. (line 139)
+* minimum precision supported by MPFR library: Auto-set. (line 238)
* mktime: Time Functions. (line 25)
* modifiers, in format specifiers: Format Modifiers. (line 6)
* monetary information, localization: Explaining gettext. (line 104)
@@ -33436,7 +33687,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)
@@ -33465,7 +33716,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 119)
* NF variable: Fields. (line 33)
* NF variable, decrementing: Changing Fields. (line 107)
* ni debugger command (alias for nexti): Debugger Execution Control.
@@ -33474,9 +33725,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 139)
* NR variable: Records. (line 6)
-* NR variable, changing: Auto-set. (line 314)
+* NR variable, changing: Auto-set. (line 328)
* null strings <1>: Basic Data Typing. (line 26)
* null strings <2>: Truth Values. (line 6)
* null strings <3>: Regexp Field Splitting.
@@ -33590,7 +33841,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 203)
* parentheses (), in a profile: Profiling. (line 146)
* parentheses (), regexp operator: Regexp Operators. (line 81)
* password file: Passwd Functions. (line 16)
@@ -33632,14 +33883,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.
@@ -33657,7 +33908,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)
@@ -33678,7 +33929,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.
@@ -33705,11 +33956,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)
@@ -33756,24 +34007,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 idIDof gawk process: Auto-set. (line 183)
-* process ID of gawk process: Auto-set. (line 186)
+* process group idIDof gawk process: Auto-set. (line 197)
+* process ID of gawk process: Auto-set. (line 200)
* 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 144)
* 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 256)
* 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 162)
* program, definition of: Getting Started. (line 21)
* programming conventions, --non-decimal-data option: Nondecimal Data.
(line 35)
@@ -33808,7 +34059,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)
@@ -33817,12 +34068,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)
@@ -33891,7 +34142,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)
@@ -33931,7 +34182,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 266)
* RLENGTH variable, match() function and: String Functions. (line 228)
* Robbins, Arnold <1>: Future Extensions. (line 6)
* Robbins, Arnold <2>: Bugs. (line 71)
@@ -33949,7 +34200,7 @@ Index
* Robbins, Miriam <2>: Getline/Pipe. (line 39)
* Robbins, Miriam: Acknowledgments. (line 94)
* Rommel, Kai Uwe: Contributors. (line 42)
-* round to nearest integer: Numeric Functions. (line 23)
+* round to nearest integer: Numeric Functions. (line 38)
* round() user-defined function: Round Function. (line 16)
* rounding numbers: Round Function. (line 6)
* ROUNDMODE variable: User-modified. (line 127)
@@ -33957,9 +34208,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 272)
* RSTART variable, match() function and: String Functions. (line 228)
-* RT variable <1>: Auto-set. (line 265)
+* RT variable <1>: Auto-set. (line 279)
* RT variable <2>: Multiple Line. (line 129)
* RT variable: awk split records. (line 125)
* Rubin, Paul <1>: Contributors. (line 15)
@@ -33972,14 +34223,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 311)
* Schorr, Andrew: Acknowledgments. (line 60)
* Schreiber, Bert: Acknowledgments. (line 38)
* Schreiber, Rita: Acknowledgments. (line 38)
@@ -33998,7 +34249,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)
@@ -34059,14 +34310,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 326)
* 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.
@@ -34088,19 +34339,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)
@@ -34150,10 +34401,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)
@@ -34224,9 +34475,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 251)
* switch statement: Switch Statement. (line 6)
-* SYMTAB array: Auto-set. (line 269)
+* SYMTAB array: Auto-set. (line 283)
* syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops.
(line 148)
* system: I/O Functions. (line 107)
@@ -34293,7 +34544,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)
@@ -34349,7 +34600,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.
@@ -34369,7 +34620,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)
@@ -34403,10 +34654,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 221)
+* version of gawk extension API: Auto-set. (line 246)
+* version of GNU MP library: Auto-set. (line 232)
+* version of GNU MPFR library: Auto-set. (line 228)
* vertical bar (|): Regexp Operators. (line 70)
* vertical bar (|), | operator (I/O) <1>: Precedence. (line 65)
* vertical bar (|), | operator (I/O): Getline/Pipe. (line 9)
@@ -34443,7 +34694,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)
@@ -34496,559 +34747,561 @@ 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: Empty403534
-Node: Using Shell Variables403851
-Node: Action Overview406124
-Node: Statements408450
-Node: If Statement410298
-Node: While Statement411793
-Node: Do Statement413821
-Node: For Statement414969
-Node: Switch Statement418127
-Node: Break Statement420509
-Node: Continue Statement422602
-Node: Next Statement424429
-Node: Nextfile Statement426810
-Node: Exit Statement429438
-Node: Built-in Variables431849
-Node: User-modified432982
-Ref: User-modified-Footnote-1440616
-Node: Auto-set440678
-Ref: Auto-set-Footnote-1453730
-Ref: Auto-set-Footnote-2453935
-Node: ARGC and ARGV453991
-Node: Pattern Action Summary458209
-Node: Arrays460642
-Node: Array Basics461971
-Node: Array Intro462815
-Ref: figure-array-elements464752
-Ref: Array Intro-Footnote-1467375
-Node: Reference to Elements467503
-Node: Assigning Elements469965
-Node: Array Example470456
-Node: Scanning an Array472215
-Node: Controlling Scanning475238
-Ref: Controlling Scanning-Footnote-1480632
-Node: Numeric Array Subscripts480948
-Node: Uninitialized Subscripts483133
-Node: Delete484750
-Ref: Delete-Footnote-1487499
-Node: Multidimensional487556
-Node: Multiscanning490653
-Node: Arrays of Arrays492242
-Node: Arrays Summary496996
-Node: Functions499087
-Node: Built-in500126
-Node: Calling Built-in501204
-Node: Numeric Functions503199
-Ref: Numeric Functions-Footnote-1507215
-Ref: Numeric Functions-Footnote-2507572
-Ref: Numeric Functions-Footnote-3507620
-Node: String Functions507892
-Ref: String Functions-Footnote-1531393
-Ref: String Functions-Footnote-2531522
-Ref: String Functions-Footnote-3531770
-Node: Gory Details531857
-Ref: table-sub-escapes533638
-Ref: table-sub-proposed535153
-Ref: table-posix-sub536515
-Ref: table-gensub-escapes538052
-Ref: Gory Details-Footnote-1538885
-Node: I/O Functions539036
-Ref: I/O Functions-Footnote-1546272
-Node: Time Functions546419
-Ref: Time Functions-Footnote-1556928
-Ref: Time Functions-Footnote-2556996
-Ref: Time Functions-Footnote-3557154
-Ref: Time Functions-Footnote-4557265
-Ref: Time Functions-Footnote-5557377
-Ref: Time Functions-Footnote-6557604
-Node: Bitwise Functions557870
-Ref: table-bitwise-ops558432
-Ref: Bitwise Functions-Footnote-1562760
-Node: Type Functions562932
-Node: I18N Functions564084
-Node: User-defined565731
-Node: Definition Syntax566536
-Ref: Definition Syntax-Footnote-1572195
-Node: Function Example572266
-Ref: Function Example-Footnote-1575187
-Node: Function Caveats575209
-Node: Calling A Function575727
-Node: Variable Scope576685
-Node: Pass By Value/Reference579678
-Node: Return Statement583175
-Node: Dynamic Typing586154
-Node: Indirect Calls587083
-Ref: Indirect Calls-Footnote-1596948
-Node: Functions Summary597076
-Node: Library Functions599778
-Ref: Library Functions-Footnote-1603386
-Ref: Library Functions-Footnote-2603529
-Node: Library Names603700
-Ref: Library Names-Footnote-1607158
-Ref: Library Names-Footnote-2607381
-Node: General Functions607467
-Node: Strtonum Function608570
-Node: Assert Function611592
-Node: Round Function614916
-Node: Cliff Random Function616457
-Node: Ordinal Functions617473
-Ref: Ordinal Functions-Footnote-1620536
-Ref: Ordinal Functions-Footnote-2620788
-Node: Join Function620999
-Ref: Join Function-Footnote-1622769
-Node: Getlocaltime Function622969
-Node: Readfile Function626713
-Node: Shell Quoting628685
-Node: Data File Management630086
-Node: Filetrans Function630718
-Node: Rewind Function634814
-Node: File Checking636200
-Ref: File Checking-Footnote-1637533
-Node: Empty Files637734
-Node: Ignoring Assigns639713
-Node: Getopt Function641263
-Ref: Getopt Function-Footnote-1652727
-Node: Passwd Functions652927
-Ref: Passwd Functions-Footnote-1661767
-Node: Group Functions661855
-Ref: Group Functions-Footnote-1669752
-Node: Walking Arrays669957
-Node: Library Functions Summary672963
-Node: Library Exercises674365
-Node: Sample Programs675645
-Node: Running Examples676415
-Node: Clones677143
-Node: Cut Program678367
-Node: Egrep Program688087
-Ref: Egrep Program-Footnote-1695590
-Node: Id Program695700
-Node: Split Program699376
-Ref: Split Program-Footnote-1702830
-Node: Tee Program702958
-Node: Uniq Program705747
-Node: Wc Program713166
-Ref: Wc Program-Footnote-1717416
-Node: Miscellaneous Programs717510
-Node: Dupword Program718723
-Node: Alarm Program720754
-Node: Translate Program725559
-Ref: Translate Program-Footnote-1730122
-Node: Labels Program730392
-Ref: Labels Program-Footnote-1733743
-Node: Word Sorting733827
-Node: History Sorting737897
-Node: Extract Program739732
-Node: Simple Sed747256
-Node: Igawk Program750326
-Ref: Igawk Program-Footnote-1764652
-Ref: Igawk Program-Footnote-2764853
-Ref: Igawk Program-Footnote-3764975
-Node: Anagram Program765090
-Node: Signature Program768151
-Node: Programs Summary769398
-Node: Programs Exercises770619
-Ref: Programs Exercises-Footnote-1774750
-Node: Advanced Features774841
-Node: Nondecimal Data776823
-Node: Array Sorting778413
-Node: Controlling Array Traversal779113
-Ref: Controlling Array Traversal-Footnote-1787479
-Node: Array Sorting Functions787597
-Ref: Array Sorting Functions-Footnote-1791483
-Node: Two-way I/O791679
-Ref: Two-way I/O-Footnote-1796624
-Ref: Two-way I/O-Footnote-2796810
-Node: TCP/IP Networking796892
-Node: Profiling799764
-Node: Advanced Features Summary807305
-Node: Internationalization809238
-Node: I18N and L10N810718
-Node: Explaining gettext811404
-Ref: Explaining gettext-Footnote-1816429
-Ref: Explaining gettext-Footnote-2816613
-Node: Programmer i18n816778
-Ref: Programmer i18n-Footnote-1821654
-Node: Translator i18n821703
-Node: String Extraction822497
-Ref: String Extraction-Footnote-1823628
-Node: Printf Ordering823714
-Ref: Printf Ordering-Footnote-1826500
-Node: I18N Portability826564
-Ref: I18N Portability-Footnote-1829020
-Node: I18N Example829083
-Ref: I18N Example-Footnote-1831886
-Node: Gawk I18N831958
-Node: I18N Summary832602
-Node: Debugger833942
-Node: Debugging834964
-Node: Debugging Concepts835405
-Node: Debugging Terms837215
-Node: Awk Debugging839787
-Node: Sample Debugging Session840693
-Node: Debugger Invocation841227
-Node: Finding The Bug842612
-Node: List of Debugger Commands849091
-Node: Breakpoint Control850423
-Node: Debugger Execution Control854100
-Node: Viewing And Changing Data857459
-Node: Execution Stack860835
-Node: Debugger Info862470
-Node: Miscellaneous Debugger Commands866515
-Node: Readline Support871516
-Node: Limitations872410
-Node: Debugging Summary874525
-Node: Arbitrary Precision Arithmetic875699
-Node: Computer Arithmetic877115
-Ref: table-numeric-ranges880692
-Ref: Computer Arithmetic-Footnote-1881216
-Node: Math Definitions881273
-Ref: table-ieee-formats884568
-Ref: Math Definitions-Footnote-1885172
-Node: MPFR features885277
-Node: FP Math Caution886948
-Ref: FP Math Caution-Footnote-1887998
-Node: Inexactness of computations888367
-Node: Inexact representation889326
-Node: Comparing FP Values890684
-Node: Errors accumulate891766
-Node: Getting Accuracy893198
-Node: Try To Round895902
-Node: Setting precision896801
-Ref: table-predefined-precision-strings897485
-Node: Setting the rounding mode899314
-Ref: table-gawk-rounding-modes899678
-Ref: Setting the rounding mode-Footnote-1903130
-Node: Arbitrary Precision Integers903309
-Ref: Arbitrary Precision Integers-Footnote-1906293
-Node: POSIX Floating Point Problems906442
-Ref: POSIX Floating Point Problems-Footnote-1910321
-Node: Floating point summary910359
-Node: Dynamic Extensions912546
-Node: Extension Intro914098
-Node: Plugin License915363
-Node: Extension Mechanism Outline916160
-Ref: figure-load-extension916588
-Ref: figure-register-new-function918068
-Ref: figure-call-new-function919072
-Node: Extension API Description921059
-Node: Extension API Functions Introduction922509
-Node: General Data Types927330
-Ref: General Data Types-Footnote-1933230
-Node: Memory Allocation Functions933529
-Ref: Memory Allocation Functions-Footnote-1936368
-Node: Constructor Functions936467
-Node: Registration Functions938206
-Node: Extension Functions938891
-Node: Exit Callback Functions941188
-Node: Extension Version String942436
-Node: Input Parsers943099
-Node: Output Wrappers952974
-Node: Two-way processors957487
-Node: Printing Messages959750
-Ref: Printing Messages-Footnote-1960826
-Node: Updating `ERRNO'960978
-Node: Requesting Values961718
-Ref: table-value-types-returned962445
-Node: Accessing Parameters963402
-Node: Symbol Table Access964636
-Node: Symbol table by name965150
-Node: Symbol table by cookie967170
-Ref: Symbol table by cookie-Footnote-1971315
-Node: Cached values971378
-Ref: Cached values-Footnote-1974874
-Node: Array Manipulation974965
-Ref: Array Manipulation-Footnote-1976063
-Node: Array Data Types976100
-Ref: Array Data Types-Footnote-1978755
-Node: Array Functions978847
-Node: Flattening Arrays982706
-Node: Creating Arrays989608
-Node: Extension API Variables994379
-Node: Extension Versioning995015
-Node: Extension API Informational Variables996906
-Node: Extension API Boilerplate997971
-Node: Finding Extensions1001780
-Node: Extension Example1002340
-Node: Internal File Description1003112
-Node: Internal File Ops1007179
-Ref: Internal File Ops-Footnote-11018930
-Node: Using Internal File Ops1019070
-Ref: Using Internal File Ops-Footnote-11021453
-Node: Extension Samples1021726
-Node: Extension Sample File Functions1023254
-Node: Extension Sample Fnmatch1030935
-Node: Extension Sample Fork1032423
-Node: Extension Sample Inplace1033638
-Node: Extension Sample Ord1035724
-Node: Extension Sample Readdir1036560
-Ref: table-readdir-file-types1037437
-Node: Extension Sample Revout1038248
-Node: Extension Sample Rev2way1038837
-Node: Extension Sample Read write array1039577
-Node: Extension Sample Readfile1041517
-Node: Extension Sample Time1042612
-Node: Extension Sample API Tests1043960
-Node: gawkextlib1044451
-Node: Extension summary1047129
-Node: Extension Exercises1050818
-Node: Language History1051540
-Node: V7/SVR3.11053196
-Node: SVR41055349
-Node: POSIX1056783
-Node: BTL1058164
-Node: POSIX/GNU1058895
-Node: Feature History1064416
-Node: Common Extensions1077514
-Node: Ranges and Locales1078886
-Ref: Ranges and Locales-Footnote-11083505
-Ref: Ranges and Locales-Footnote-21083532
-Ref: Ranges and Locales-Footnote-31083767
-Node: Contributors1083988
-Node: History summary1089528
-Node: Installation1090907
-Node: Gawk Distribution1091853
-Node: Getting1092337
-Node: Extracting1093160
-Node: Distribution contents1094797
-Node: Unix Installation1100551
-Node: Quick Installation1101168
-Node: Additional Configuration Options1103592
-Node: Configuration Philosophy1105395
-Node: Non-Unix Installation1107764
-Node: PC Installation1108222
-Node: PC Binary Installation1109542
-Node: PC Compiling1111390
-Ref: PC Compiling-Footnote-11114411
-Node: PC Testing1114520
-Node: PC Using1115696
-Node: Cygwin1119811
-Node: MSYS1120581
-Node: VMS Installation1121082
-Node: VMS Compilation1121874
-Ref: VMS Compilation-Footnote-11123103
-Node: VMS Dynamic Extensions1123161
-Node: VMS Installation Details1124845
-Node: VMS Running1127096
-Node: VMS GNV1129936
-Node: VMS Old Gawk1130671
-Node: Bugs1131141
-Node: Other Versions1135030
-Node: Installation summary1141464
-Node: Notes1142523
-Node: Compatibility Mode1143388
-Node: Additions1144170
-Node: Accessing The Source1145095
-Node: Adding Code1146530
-Node: New Ports1152687
-Node: Derived Files1157169
-Ref: Derived Files-Footnote-11162644
-Ref: Derived Files-Footnote-21162678
-Ref: Derived Files-Footnote-31163274
-Node: Future Extensions1163388
-Node: Implementation Limitations1163994
-Node: Extension Design1165242
-Node: Old Extension Problems1166396
-Ref: Old Extension Problems-Footnote-11167913
-Node: Extension New Mechanism Goals1167970
-Ref: Extension New Mechanism Goals-Footnote-11171330
-Node: Extension Other Design Decisions1171519
-Node: Extension Future Growth1173627
-Node: Old Extension Mechanism1174463
-Node: Notes summary1176225
-Node: Basic Concepts1177411
-Node: Basic High Level1178092
-Ref: figure-general-flow1178364
-Ref: figure-process-flow1178963
-Ref: Basic High Level-Footnote-11182192
-Node: Basic Data Typing1182377
-Node: Glossary1185705
-Node: Copying1217634
-Node: GNU Free Documentation License1255190
-Node: Index1280326
+Node: Foreword342291
+Node: Foreword446735
+Node: Preface48266
+Ref: Preface-Footnote-151137
+Ref: Preface-Footnote-251244
+Ref: Preface-Footnote-351477
+Node: History51619
+Node: Names53970
+Ref: Names-Footnote-155064
+Node: This Manual55210
+Ref: This Manual-Footnote-161710
+Node: Conventions61810
+Node: Manual History64147
+Ref: Manual History-Footnote-167140
+Ref: Manual History-Footnote-267181
+Node: How To Contribute67255
+Node: Acknowledgments68384
+Node: Getting Started73250
+Node: Running gawk75689
+Node: One-shot76879
+Node: Read Terminal78143
+Node: Long80174
+Node: Executable Scripts81687
+Ref: Executable Scripts-Footnote-184476
+Node: Comments84579
+Node: Quoting87061
+Node: DOS Quoting92579
+Node: Sample Data Files93254
+Node: Very Simple95849
+Node: Two Rules100748
+Node: More Complex102634
+Node: Statements/Lines105496
+Ref: Statements/Lines-Footnote-1109951
+Node: Other Features110216
+Node: When111152
+Ref: When-Footnote-1112906
+Node: Intro Summary112971
+Node: Invoking Gawk113855
+Node: Command Line115369
+Node: Options116167
+Ref: Options-Footnote-1131962
+Ref: Options-Footnote-2132191
+Node: Other Arguments132216
+Node: Naming Standard Input135164
+Node: Environment Variables136257
+Node: AWKPATH Variable136815
+Ref: AWKPATH Variable-Footnote-1140222
+Ref: AWKPATH Variable-Footnote-2140267
+Node: AWKLIBPATH Variable140527
+Node: Other Environment Variables141783
+Node: Exit Status145414
+Node: Include Files146090
+Node: Loading Shared Libraries149679
+Node: Obsolete151106
+Node: Undocumented151798
+Node: Invoking Summary152065
+Node: Regexp153728
+Node: Regexp Usage155182
+Node: Escape Sequences157219
+Node: Regexp Operators163448
+Ref: Regexp Operators-Footnote-1170858
+Ref: Regexp Operators-Footnote-2171005
+Node: Bracket Expressions171103
+Ref: table-char-classes173118
+Node: Leftmost Longest176060
+Node: Computed Regexps177362
+Node: GNU Regexp Operators180791
+Node: Case-sensitivity184463
+Ref: Case-sensitivity-Footnote-1187348
+Ref: Case-sensitivity-Footnote-2187583
+Node: Regexp Summary187691
+Node: Reading Files189158
+Node: Records191251
+Node: awk split records191984
+Node: gawk split records196913
+Ref: gawk split records-Footnote-1201452
+Node: Fields201489
+Ref: Fields-Footnote-1204267
+Node: Nonconstant Fields204353
+Ref: Nonconstant Fields-Footnote-1206591
+Node: Changing Fields206794
+Node: Field Separators212725
+Node: Default Field Splitting215429
+Node: Regexp Field Splitting216546
+Node: Single Character Fields219896
+Node: Command Line Field Separator220955
+Node: Full Line Fields224172
+Ref: Full Line Fields-Footnote-1225693
+Ref: Full Line Fields-Footnote-2225739
+Node: Field Splitting Summary225840
+Node: Constant Size227914
+Node: Splitting By Content232493
+Ref: Splitting By Content-Footnote-1236458
+Node: Multiple Line236621
+Ref: Multiple Line-Footnote-1242502
+Node: Getline242681
+Node: Plain Getline244888
+Node: Getline/Variable247528
+Node: Getline/File248677
+Node: Getline/Variable/File250062
+Ref: Getline/Variable/File-Footnote-1251665
+Node: Getline/Pipe251752
+Node: Getline/Variable/Pipe254430
+Node: Getline/Coprocess255561
+Node: Getline/Variable/Coprocess256825
+Node: Getline Notes257564
+Node: Getline Summary260358
+Ref: table-getline-variants260770
+Node: Read Timeout261599
+Ref: Read Timeout-Footnote-1265436
+Node: Command-line directories265494
+Node: Input Summary266399
+Node: Input Exercises269784
+Node: Printing270512
+Node: Print272347
+Node: Print Examples273804
+Node: Output Separators276583
+Node: OFMT278601
+Node: Printf279956
+Node: Basic Printf280741
+Node: Control Letters282313
+Node: Format Modifiers286298
+Node: Printf Examples292304
+Node: Redirection294790
+Node: Special FD301628
+Ref: Special FD-Footnote-1304794
+Node: Special Files304868
+Node: Other Inherited Files305485
+Node: Special Network306485
+Node: Special Caveats307347
+Node: Close Files And Pipes308296
+Ref: Close Files And Pipes-Footnote-1315481
+Ref: Close Files And Pipes-Footnote-2315629
+Node: Nonfatal315779
+Node: Output Summary318104
+Node: Output Exercises319325
+Node: Expressions320005
+Node: Values321194
+Node: Constants321871
+Node: Scalar Constants322562
+Ref: Scalar Constants-Footnote-1323424
+Node: Nondecimal-numbers323674
+Node: Regexp Constants326684
+Node: Using Constant Regexps327210
+Node: Variables330373
+Node: Using Variables331030
+Node: Assignment Options332941
+Node: Conversion334816
+Node: Strings And Numbers335340
+Ref: Strings And Numbers-Footnote-1338405
+Node: Locale influences conversions338514
+Ref: table-locale-affects341260
+Node: All Operators341852
+Node: Arithmetic Ops342481
+Node: Concatenation344986
+Ref: Concatenation-Footnote-1347805
+Node: Assignment Ops347912
+Ref: table-assign-ops352891
+Node: Increment Ops354201
+Node: Truth Values and Conditions357632
+Node: Truth Values358715
+Node: Typing and Comparison359764
+Node: Variable Typing360580
+Node: Comparison Operators364247
+Ref: table-relational-ops364657
+Node: POSIX String Comparison368152
+Ref: POSIX String Comparison-Footnote-1369224
+Node: Boolean Ops369363
+Ref: Boolean Ops-Footnote-1373841
+Node: Conditional Exp373932
+Node: Function Calls375670
+Node: Precedence379550
+Node: Locales383210
+Node: Expressions Summary384842
+Node: Patterns and Actions387413
+Node: Pattern Overview388533
+Node: Regexp Patterns390212
+Node: Expression Patterns390755
+Node: Ranges394535
+Node: BEGIN/END397642
+Node: Using BEGIN/END398403
+Ref: Using BEGIN/END-Footnote-1401139
+Node: I/O And BEGIN/END401245
+Node: BEGINFILE/ENDFILE403560
+Node: Empty406457
+Node: Using Shell Variables406774
+Node: Action Overview409047
+Node: Statements411373
+Node: If Statement413221
+Node: While Statement414716
+Node: Do Statement416744
+Node: For Statement417892
+Node: Switch Statement421050
+Node: Break Statement423432
+Node: Continue Statement425525
+Node: Next Statement427352
+Node: Nextfile Statement429733
+Node: Exit Statement432361
+Node: Built-in Variables434772
+Node: User-modified435905
+Ref: User-modified-Footnote-1443539
+Node: Auto-set443601
+Ref: Auto-set-Footnote-1457310
+Ref: Auto-set-Footnote-2457515
+Node: ARGC and ARGV457571
+Node: Pattern Action Summary461789
+Node: Arrays464222
+Node: Array Basics465551
+Node: Array Intro466395
+Ref: figure-array-elements468332
+Ref: Array Intro-Footnote-1470955
+Node: Reference to Elements471083
+Node: Assigning Elements473545
+Node: Array Example474036
+Node: Scanning an Array475795
+Node: Controlling Scanning478818
+Ref: Controlling Scanning-Footnote-1484212
+Node: Numeric Array Subscripts484528
+Node: Uninitialized Subscripts486713
+Node: Delete488330
+Ref: Delete-Footnote-1491079
+Node: Multidimensional491136
+Node: Multiscanning494233
+Node: Arrays of Arrays495822
+Node: Arrays Summary500576
+Node: Functions502667
+Node: Built-in503706
+Node: Calling Built-in504784
+Node: Numeric Functions506779
+Ref: Numeric Functions-Footnote-1511597
+Ref: Numeric Functions-Footnote-2511954
+Ref: Numeric Functions-Footnote-3512002
+Node: String Functions512274
+Ref: String Functions-Footnote-1535775
+Ref: String Functions-Footnote-2535904
+Ref: String Functions-Footnote-3536152
+Node: Gory Details536239
+Ref: table-sub-escapes538020
+Ref: table-sub-proposed539535
+Ref: table-posix-sub540897
+Ref: table-gensub-escapes542434
+Ref: Gory Details-Footnote-1543267
+Node: I/O Functions543418
+Ref: I/O Functions-Footnote-1550654
+Node: Time Functions550801
+Ref: Time Functions-Footnote-1561310
+Ref: Time Functions-Footnote-2561378
+Ref: Time Functions-Footnote-3561536
+Ref: Time Functions-Footnote-4561647
+Ref: Time Functions-Footnote-5561759
+Ref: Time Functions-Footnote-6561986
+Node: Bitwise Functions562252
+Ref: table-bitwise-ops562814
+Ref: Bitwise Functions-Footnote-1567142
+Node: Type Functions567314
+Node: I18N Functions568466
+Node: User-defined570113
+Node: Definition Syntax570918
+Ref: Definition Syntax-Footnote-1576577
+Node: Function Example576648
+Ref: Function Example-Footnote-1579569
+Node: Function Caveats579591
+Node: Calling A Function580109
+Node: Variable Scope581067
+Node: Pass By Value/Reference584060
+Node: Return Statement587557
+Node: Dynamic Typing590536
+Node: Indirect Calls591465
+Ref: Indirect Calls-Footnote-1601330
+Node: Functions Summary601458
+Node: Library Functions604160
+Ref: Library Functions-Footnote-1607768
+Ref: Library Functions-Footnote-2607911
+Node: Library Names608082
+Ref: Library Names-Footnote-1611540
+Ref: Library Names-Footnote-2611763
+Node: General Functions611849
+Node: Strtonum Function612952
+Node: Assert Function615974
+Node: Round Function619298
+Node: Cliff Random Function620839
+Node: Ordinal Functions621855
+Ref: Ordinal Functions-Footnote-1624918
+Ref: Ordinal Functions-Footnote-2625170
+Node: Join Function625381
+Ref: Join Function-Footnote-1627151
+Node: Getlocaltime Function627351
+Node: Readfile Function631095
+Node: Shell Quoting633067
+Node: Data File Management634468
+Node: Filetrans Function635100
+Node: Rewind Function639196
+Node: File Checking640582
+Ref: File Checking-Footnote-1641915
+Node: Empty Files642116
+Node: Ignoring Assigns644095
+Node: Getopt Function645645
+Ref: Getopt Function-Footnote-1657109
+Node: Passwd Functions657309
+Ref: Passwd Functions-Footnote-1666149
+Node: Group Functions666237
+Ref: Group Functions-Footnote-1674134
+Node: Walking Arrays674339
+Node: Library Functions Summary677345
+Node: Library Exercises678747
+Node: Sample Programs680027
+Node: Running Examples680797
+Node: Clones681525
+Node: Cut Program682749
+Node: Egrep Program692469
+Ref: Egrep Program-Footnote-1699972
+Node: Id Program700082
+Node: Split Program703758
+Ref: Split Program-Footnote-1707212
+Node: Tee Program707340
+Node: Uniq Program710129
+Node: Wc Program717548
+Ref: Wc Program-Footnote-1721798
+Node: Miscellaneous Programs721892
+Node: Dupword Program723105
+Node: Alarm Program725136
+Node: Translate Program729941
+Ref: Translate Program-Footnote-1734504
+Node: Labels Program734774
+Ref: Labels Program-Footnote-1738125
+Node: Word Sorting738209
+Node: History Sorting742279
+Node: Extract Program744114
+Node: Simple Sed751638
+Node: Igawk Program754708
+Ref: Igawk Program-Footnote-1769034
+Ref: Igawk Program-Footnote-2769235
+Ref: Igawk Program-Footnote-3769357
+Node: Anagram Program769472
+Node: Signature Program772533
+Node: Programs Summary773780
+Node: Programs Exercises775001
+Ref: Programs Exercises-Footnote-1779132
+Node: Advanced Features779223
+Node: Nondecimal Data781205
+Node: Array Sorting782795
+Node: Controlling Array Traversal783495
+Ref: Controlling Array Traversal-Footnote-1791861
+Node: Array Sorting Functions791979
+Ref: Array Sorting Functions-Footnote-1795865
+Node: Two-way I/O796061
+Ref: Two-way I/O-Footnote-1801006
+Ref: Two-way I/O-Footnote-2801192
+Node: TCP/IP Networking801274
+Node: Profiling804146
+Node: Advanced Features Summary812417
+Node: Internationalization814350
+Node: I18N and L10N815830
+Node: Explaining gettext816516
+Ref: Explaining gettext-Footnote-1821541
+Ref: Explaining gettext-Footnote-2821725
+Node: Programmer i18n821890
+Ref: Programmer i18n-Footnote-1826766
+Node: Translator i18n826815
+Node: String Extraction827609
+Ref: String Extraction-Footnote-1828740
+Node: Printf Ordering828826
+Ref: Printf Ordering-Footnote-1831612
+Node: I18N Portability831676
+Ref: I18N Portability-Footnote-1834132
+Node: I18N Example834195
+Ref: I18N Example-Footnote-1836998
+Node: Gawk I18N837070
+Node: I18N Summary837714
+Node: Debugger839054
+Node: Debugging840076
+Node: Debugging Concepts840517
+Node: Debugging Terms842327
+Node: Awk Debugging844899
+Node: Sample Debugging Session845805
+Node: Debugger Invocation846339
+Node: Finding The Bug847724
+Node: List of Debugger Commands854203
+Node: Breakpoint Control855535
+Node: Debugger Execution Control859212
+Node: Viewing And Changing Data862571
+Node: Execution Stack865947
+Node: Debugger Info867582
+Node: Miscellaneous Debugger Commands871627
+Node: Readline Support876628
+Node: Limitations877522
+Node: Debugging Summary879637
+Node: Arbitrary Precision Arithmetic880811
+Node: Computer Arithmetic882227
+Ref: table-numeric-ranges885804
+Ref: Computer Arithmetic-Footnote-1886328
+Node: Math Definitions886385
+Ref: table-ieee-formats889680
+Ref: Math Definitions-Footnote-1890284
+Node: MPFR features890389
+Node: FP Math Caution892060
+Ref: FP Math Caution-Footnote-1893110
+Node: Inexactness of computations893479
+Node: Inexact representation894438
+Node: Comparing FP Values895796
+Node: Errors accumulate896878
+Node: Getting Accuracy898310
+Node: Try To Round901014
+Node: Setting precision901913
+Ref: table-predefined-precision-strings902597
+Node: Setting the rounding mode904426
+Ref: table-gawk-rounding-modes904790
+Ref: Setting the rounding mode-Footnote-1908242
+Node: Arbitrary Precision Integers908421
+Ref: Arbitrary Precision Integers-Footnote-1913319
+Node: POSIX Floating Point Problems913468
+Ref: POSIX Floating Point Problems-Footnote-1917347
+Node: Floating point summary917385
+Node: Dynamic Extensions919572
+Node: Extension Intro921124
+Node: Plugin License922389
+Node: Extension Mechanism Outline923186
+Ref: figure-load-extension923614
+Ref: figure-register-new-function925094
+Ref: figure-call-new-function926098
+Node: Extension API Description928085
+Node: Extension API Functions Introduction929535
+Node: General Data Types934356
+Ref: General Data Types-Footnote-1940256
+Node: Memory Allocation Functions940555
+Ref: Memory Allocation Functions-Footnote-1943394
+Node: Constructor Functions943493
+Node: Registration Functions945232
+Node: Extension Functions945917
+Node: Exit Callback Functions948214
+Node: Extension Version String949462
+Node: Input Parsers950125
+Node: Output Wrappers960000
+Node: Two-way processors964513
+Node: Printing Messages966776
+Ref: Printing Messages-Footnote-1967852
+Node: Updating `ERRNO'968004
+Node: Requesting Values968744
+Ref: table-value-types-returned969471
+Node: Accessing Parameters970428
+Node: Symbol Table Access971662
+Node: Symbol table by name972176
+Node: Symbol table by cookie974196
+Ref: Symbol table by cookie-Footnote-1978341
+Node: Cached values978404
+Ref: Cached values-Footnote-1981900
+Node: Array Manipulation981991
+Ref: Array Manipulation-Footnote-1983089
+Node: Array Data Types983126
+Ref: Array Data Types-Footnote-1985781
+Node: Array Functions985873
+Node: Flattening Arrays989732
+Node: Creating Arrays996634
+Node: Extension API Variables1001405
+Node: Extension Versioning1002041
+Node: Extension API Informational Variables1003932
+Node: Extension API Boilerplate1004997
+Node: Finding Extensions1008806
+Node: Extension Example1009366
+Node: Internal File Description1010138
+Node: Internal File Ops1014205
+Ref: Internal File Ops-Footnote-11025956
+Node: Using Internal File Ops1026096
+Ref: Using Internal File Ops-Footnote-11028479
+Node: Extension Samples1028752
+Node: Extension Sample File Functions1030280
+Node: Extension Sample Fnmatch1037961
+Node: Extension Sample Fork1039449
+Node: Extension Sample Inplace1040664
+Node: Extension Sample Ord1042750
+Node: Extension Sample Readdir1043586
+Ref: table-readdir-file-types1044463
+Node: Extension Sample Revout1045274
+Node: Extension Sample Rev2way1045863
+Node: Extension Sample Read write array1046603
+Node: Extension Sample Readfile1048543
+Node: Extension Sample Time1049638
+Node: Extension Sample API Tests1050986
+Node: gawkextlib1051477
+Node: Extension summary1054155
+Node: Extension Exercises1057844
+Node: Language History1058566
+Node: V7/SVR3.11060222
+Node: SVR41062375
+Node: POSIX1063809
+Node: BTL1065190
+Node: POSIX/GNU1065921
+Node: Feature History1071757
+Node: Common Extensions1085551
+Node: Ranges and Locales1086923
+Ref: Ranges and Locales-Footnote-11091542
+Ref: Ranges and Locales-Footnote-21091569
+Ref: Ranges and Locales-Footnote-31091804
+Node: Contributors1092025
+Node: History summary1097565
+Node: Installation1098944
+Node: Gawk Distribution1099890
+Node: Getting1100374
+Node: Extracting1101197
+Node: Distribution contents1102834
+Node: Unix Installation1108936
+Node: Quick Installation1109619
+Node: Shell Startup Files1112030
+Node: Additional Configuration Options1113109
+Node: Configuration Philosophy1114913
+Node: Non-Unix Installation1117282
+Node: PC Installation1117740
+Node: PC Binary Installation1119060
+Node: PC Compiling1120908
+Ref: PC Compiling-Footnote-11123929
+Node: PC Testing1124038
+Node: PC Using1125214
+Node: Cygwin1129329
+Node: MSYS1130099
+Node: VMS Installation1130600
+Node: VMS Compilation1131392
+Ref: VMS Compilation-Footnote-11132621
+Node: VMS Dynamic Extensions1132679
+Node: VMS Installation Details1134363
+Node: VMS Running1136614
+Node: VMS GNV1139454
+Node: VMS Old Gawk1140189
+Node: Bugs1140659
+Node: Other Versions1144548
+Node: Installation summary1150982
+Node: Notes1152041
+Node: Compatibility Mode1152906
+Node: Additions1153688
+Node: Accessing The Source1154613
+Node: Adding Code1156048
+Node: New Ports1162205
+Node: Derived Files1166687
+Ref: Derived Files-Footnote-11172162
+Ref: Derived Files-Footnote-21172196
+Ref: Derived Files-Footnote-31172792
+Node: Future Extensions1172906
+Node: Implementation Limitations1173512
+Node: Extension Design1174760
+Node: Old Extension Problems1175914
+Ref: Old Extension Problems-Footnote-11177431
+Node: Extension New Mechanism Goals1177488
+Ref: Extension New Mechanism Goals-Footnote-11180848
+Node: Extension Other Design Decisions1181037
+Node: Extension Future Growth1183145
+Node: Old Extension Mechanism1183981
+Node: Notes summary1185743
+Node: Basic Concepts1186929
+Node: Basic High Level1187610
+Ref: figure-general-flow1187882
+Ref: figure-process-flow1188481
+Ref: Basic High Level-Footnote-11191710
+Node: Basic Data Typing1191895
+Node: Glossary1195223
+Node: Copying1227152
+Node: GNU Free Documentation License1264708
+Node: Index1289844

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 96d3370e..8005fe3f 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -633,6 +633,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
@@ -1002,6 +1003,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 +4084,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 +4486,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 +4520,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 +4550,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 +4601,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.
@@ -5180,17 +5180,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
@@ -8934,6 +8938,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
@@ -10440,6 +10445,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
@@ -10468,6 +10538,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
@@ -14801,10 +14877,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
@@ -16944,6 +17034,23 @@ You can use @samp{pi = atan2(0, -1)} to retrieve the value of
@cindex cosine
Return the cosine of @var{x}, with @var{x} in radians.
+@item @code{div(@var{numerator}, @var{denominator}, @var{result})}
+@cindexawkfunc{div}
+@cindex div
+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{exp(@var{x})}
@cindexawkfunc{exp}
@cindex exponent
@@ -27747,8 +27854,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
@@ -27842,10 +27948,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
@@ -30919,6 +31041,119 @@ 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{div()} function (@pxref{Numeric Functions}).
+
+You can simulate the @code{div()} function in standard @command{awk}
+using this user-defined function:
+
+@example
+@c file eg/lib/div.awk
+# div --- do integer division
+
+@c endfile
+@ignore
+@c file eg/lib/div.awk
+#
+# Arnold Robbins, arnold@@skeeve.com, Public Domain
+# July, 2014
+
+@c endfile
+
+@end ignore
+@c file eg/lib/div.awk
+function div(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{div()} 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
+ div(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
@@ -35552,6 +35787,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
@@ -35639,6 +35878,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{div()} function for doing integer
+division and remainder
+(@pxref{Numeric Functions})
@end itemize
@item
@@ -35771,6 +36015,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
@@ -36383,6 +36637,44 @@ with a minimum of two
The dynamic extension interface was completely redone
(@pxref{Dynamic Extensions}).
+@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{div()} 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
@@ -37049,6 +37341,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
@@ -37093,8 +37387,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
@@ -37105,6 +37397,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.
@@ -37136,6 +37434,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
@@ -37216,6 +37515,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 08a9f7c3..88e854a5 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -628,6 +628,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
@@ -997,6 +998,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 +3995,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 +4397,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 +4431,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 +4461,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 +4512,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.
@@ -5091,17 +5091,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
@@ -8534,6 +8538,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
@@ -9936,6 +9941,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
@@ -9964,6 +10034,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
@@ -14129,10 +14205,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
@@ -16226,6 +16316,23 @@ You can use @samp{pi = atan2(0, -1)} to retrieve the value of
@cindex cosine
Return the cosine of @var{x}, with @var{x} in radians.
+@item @code{div(@var{numerator}, @var{denominator}, @var{result})}
+@cindexawkfunc{div}
+@cindex div
+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{exp(@var{x})}
@cindexawkfunc{exp}
@cindex exponent
@@ -26838,8 +26945,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
@@ -26933,10 +27039,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
@@ -30010,6 +30132,119 @@ 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{div()} function (@pxref{Numeric Functions}).
+
+You can simulate the @code{div()} function in standard @command{awk}
+using this user-defined function:
+
+@example
+@c file eg/lib/div.awk
+# div --- do integer division
+
+@c endfile
+@ignore
+@c file eg/lib/div.awk
+#
+# Arnold Robbins, arnold@@skeeve.com, Public Domain
+# July, 2014
+
+@c endfile
+
+@end ignore
+@c file eg/lib/div.awk
+function div(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{div()} 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
+ div(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
@@ -34643,6 +34878,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
@@ -34730,6 +34969,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{div()} function for doing integer
+division and remainder
+(@pxref{Numeric Functions})
@end itemize
@item
@@ -34862,6 +35106,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
@@ -35474,6 +35728,44 @@ with a minimum of two
The dynamic extension interface was completely redone
(@pxref{Dynamic Extensions}).
+@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{div()} 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
@@ -36140,6 +36432,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
@@ -36184,8 +36478,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
@@ -36196,6 +36488,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.
@@ -36227,6 +36525,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
@@ -36307,6 +36606,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