aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-06-12 22:03:33 +0300
committerArnold D. Robbins <arnold@skeeve.com>2014-06-12 22:03:33 +0300
commitaf22ae5e8cfbea8a31583975bc6b5daf1d9a6c48 (patch)
treea9c0d24bfc91882cdc4815cbc3ff2b52aafa37e3
parenta09ff78b4fc11a487be7f3dd4cdf75aa34ec54da (diff)
parent4a42ca2e31b40f0d46634f9ab77d82e4fe727c22 (diff)
downloadegawk-af22ae5e8cfbea8a31583975bc6b5daf1d9a6c48.tar.gz
egawk-af22ae5e8cfbea8a31583975bc6b5daf1d9a6c48.tar.bz2
egawk-af22ae5e8cfbea8a31583975bc6b5daf1d9a6c48.zip
Merge branch 'gawk-4.1-stable'
-rw-r--r--doc/ChangeLog4
-rw-r--r--doc/gawk.info648
-rw-r--r--doc/gawk.texi347
-rw-r--r--doc/gawktexi.in347
4 files changed, 908 insertions, 438 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 28cad6e0..cd175516 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2014-06-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: More "Summary" sections. Through chapter 14.
+
2014-06-11 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: More "Summary" sections. Through chapter 10.
diff --git a/doc/gawk.info b/doc/gawk.info
index 7c7af5eb..33dc1f01 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -14022,9 +14022,9 @@ File: gawk.info, Node: Functions Summary, Prev: Indirect Calls, Up: Functions
It is more straightforward in `gawk''s `gensub()' function, but
that function still requires care in its use.
- * User-defined functions provide important capabilities but come
- with some syntactic inelegancies. In a function call, there cannot
- be any space between the function name and the opening left
+ * User-defined functions provide important capabilities but come with
+ some syntactic inelegancies. In a function call, there cannot be
+ any space between the function name and the opening left
parethesis of the argument list. Also, there is no provision for
local variables, so the convention is to add extra parameters, and
to separate them visually from the real parameters by extra
@@ -14044,8 +14044,8 @@ File: gawk.info, Node: Functions Summary, Prev: Indirect Calls, Up: Functions
scalar values may be returned by a function.
* If a variable that has never been used is passed to a user-defined
- function, how that function treats the variable can set its
- nature: either scalar or array.
+ function, how that function treats the variable can set its nature:
+ either scalar or array.
* `gawk' provides indirect function calls using a special syntax.
By setting a variable to the name of a user-defined function, you
@@ -15961,6 +15961,7 @@ Library Functions::.
* Running Examples:: How to run these examples.
* Clones:: Clones of common utilities.
* Miscellaneous Programs:: Some interesting `awk' programs.
+* Programs Summary:: Summary of programs.

File: gawk.info, Node: Running Examples, Next: Clones, Up: Sample Programs
@@ -17176,7 +17177,7 @@ has already been reset by the time `endfile()' is called.
characters, not bytes.

-File: gawk.info, Node: Miscellaneous Programs, Prev: Clones, Up: Sample Programs
+File: gawk.info, Node: Miscellaneous Programs, Next: Programs Summary, Prev: Clones, Up: Sample Programs
11.3 A Grab Bag of `awk' Programs
=================================
@@ -18572,6 +18573,36 @@ truly desperate to understand it, see Chris Johansen's explanation,
which is embedded in the Texinfo source file for this Info file.)

+File: gawk.info, Node: Programs Summary, Prev: Miscellaneous Programs, Up: Sample Programs
+
+11.4 Summary
+============
+
+ * The functions provided in this major node and the previous one
+ continue on the theme that reading programs is an excellent way to
+ learn Good Programming.
+
+ * Using `#!' to make `awk' programs directly runnable makes them
+ easier to use. Otherwise, invoke the program using `awk -f ...'.
+
+ * Reimplementing standard POSIX programs in `awk' is a pleasant
+ exercise; `awk''s expressive power lets you write such programs in
+ relatively few lines of code, yet they are functionally complete
+ and usable.
+
+ * One of standard `awk''s weaknesses is working with individual
+ characters. The ability to use `split()' with the empty string as
+ the separator can considerably simplify such tasks.
+
+ * The library functions from *note Library Functions::, proved their
+ usefulness for a number of real (if small) programs.
+
+ * Besides reinventing POSIX wheels, other programs solved a
+ selection of interesting problems, such as finding duplicates
+ words in text, printing mailing labels, and finding anagrams.
+
+
+
File: gawk.info, Node: Advanced Features, Next: Internationalization, Prev: Sample Programs, Up: Top
12 Advanced Features of `gawk'
@@ -18615,6 +18646,7 @@ own:
* Two-way I/O:: Two-way communications with another process.
* TCP/IP Networking:: Using `gawk' for network programming.
* Profiling:: Profiling your `awk' programs.
+* Advanced Features Summary:: Summary of advanced features.

File: gawk.info, Node: Nondecimal Data, Next: Array Sorting, Up: Advanced Features
@@ -19217,7 +19249,7 @@ much more complete introduction and discussion, as well as extensive
examples.

-File: gawk.info, Node: Profiling, Prev: TCP/IP Networking, Up: Advanced Features
+File: gawk.info, Node: Profiling, Next: Advanced Features Summary, Prev: TCP/IP Networking, Up: Advanced Features
12.5 Profiling Your `awk' Programs
==================================
@@ -19446,6 +19478,48 @@ without any execution counts.
will change in the next major release.

+File: gawk.info, Node: Advanced Features Summary, Prev: Profiling, Up: Advanced Features
+
+12.6 Summary
+============
+
+ * The `--non-decimal-data' option causes `gawk' to treat octal- and
+ hexadecimal-looking input data as octal and hexadecimal. This
+ option should be used with caution or not at all; use of
+ `strtonum()' is preferable.
+
+ * You can take over complete control of sorting in `for (INDX in
+ ARRAY)' array traversal by setting `PROCINFO["sorted_in"]' to the
+ name of a user-defined function that does the comparison of array
+ elements based on index and value.
+
+ * Similarly, you can supply the name of a user-defined comparison
+ function as the third argument to either `asort()' or `asorti()'
+ to control how those functions sort arrays. Or you may provide one
+ of the predefined control strings that work for
+ `PROCINFO["sorted_in"]'.
+
+ * You can use the `|&' operator to create a two-way pipe to a
+ co-process. You read from the co-process with `getline' and write
+ to it with `print' or `printf'. Use `close()' to close off the
+ co-process completely, or optionally, close off one side of the
+ two-way communications.
+
+ * By using special "file names" with the `|&' operator, you can open
+ a TCP/IP (or UDP/IP) connection to remote hosts in the Internet.
+ `gawk' supports both IPv4 an IPv6.
+
+ * You can generate statement count profiles of your program. This
+ can help you determine which parts of your program may be taking
+ the most time and let you tune them more easily. Sending the
+ `USR1' signal while profiling causes `gawk' to dump the profile
+ and keep going, including a function call stack.
+
+ * You can also just "pretty print" the program. This currently also
+ runs the program, but that will change in the next major release.
+
+
+
File: gawk.info, Node: Internationalization, Next: Debugger, Prev: Advanced Features, Up: Top
13 Internationalization with `gawk'
@@ -19475,6 +19549,7 @@ requirement.
* Translator i18n:: Features for the translator.
* I18N Example:: A simple i18n example.
* Gawk I18N:: `gawk' is also internationalized.
+* I18N Summary:: Summary of I18N stuff.

File: gawk.info, Node: I18N and L10N, Next: Explaining gettext, Up: Internationalization
@@ -20013,7 +20088,7 @@ and `bindtextdomain()' (*note I18N Portability::) are in a file named
(1) Perhaps it would be better if it were called "Hippy." Ah, well.

-File: gawk.info, Node: Gawk I18N, Prev: I18N Example, Up: Internationalization
+File: gawk.info, Node: Gawk I18N, Next: I18N Summary, Prev: I18N Example, Up: Internationalization
13.6 `gawk' Can Speak Your Language
===================================
@@ -20028,6 +20103,39 @@ writing, the latest version of GNU `gettext' is version 0.19.1
usage messages, warnings, and fatal errors in the local language.

+File: gawk.info, Node: I18N Summary, Prev: Gawk I18N, Up: Internationalization
+
+13.7 Summary
+============
+
+ * Internationalization means writing a program such that it can use
+ multiple languages without requiring source-code changes.
+ Localization means providing the data necessary for an
+ internationalized program to work in a particular language.
+
+ * `gawk' uses GNU `gettext' to let you internationalize and localize
+ `awk' programs. A program's text domain identifies the program
+ for grouping all messages and other data together.
+
+ * You mark a program's strings for translation by preceding them with
+ an underscore. Once that is done, the strings are extracted into a
+ `.pot' file. This file is copied for each langauge into a `.po'
+ file, and the `.po' files are compiled into `.gmo' files for use
+ at runtime.
+
+ * You can use position specifications with `sprintf()' and `printf'
+ to rearrange the placement of argument values in formatted strings
+ and output. This is useful for the translations of format control
+ strings.
+
+ * The internationalization features have been designed so that they
+ can be easily worked around in a standard `awk'.
+
+ * `gawk' itself has been internationalized and ships with a number
+ of translations for its messages.
+
+
+
File: gawk.info, Node: Debugger, Next: Arbitrary Precision Arithmetic, Prev: Internationalization, Up: Top
14 Debugging `awk' Programs
@@ -20050,6 +20158,7 @@ program is easy.
* List of Debugger Commands:: Main debugger commands.
* Readline Support:: Readline support.
* Limitations:: Limitations and future plans.
+* Debugging Summary:: Debugging summary.

File: gawk.info, Node: Debugging, Next: Sample Debugging Session, Up: Debugger
@@ -21028,7 +21137,7 @@ Variable name completion

-File: gawk.info, Node: Limitations, Prev: Readline Support, Up: Debugger
+File: gawk.info, Node: Limitations, Next: Debugging Summary, Prev: Readline Support, Up: Debugger
14.5 Limitations and Future Plans
=================================
@@ -21075,6 +21184,35 @@ features may be added, and of course feel free to try to add them
yourself!

+File: gawk.info, Node: Debugging Summary, Prev: Limitations, Up: Debugger
+
+14.6 Summary
+============
+
+ * Programs rarely work correctly the first time. Finding bugs is
+ "debugging" and a program that helps you find bugs is a
+ "debugger". `gawk' has a built-in debugger that works very
+ similarly to the GNU Debugger, GDB.
+
+ * Debuggers let you step through your program one statement at a
+ time, examine and change variable and array values, and do a
+ number of other things that let understand what your program is
+ actually doing (as opposed to what it is supposed to do).
+
+ * Like most debuggers, the `gawk' debugger works in terms of stack
+ frames, and lets you set both breakpoints (stop at a point in the
+ code) and watchpoints (stop when a data value changes).
+
+ * The debugger command set is fairly complete, providing control over
+ breakpoints, execution, viewing and changing data, working with
+ the stack, getting information, and other tasks.
+
+ * If the `readline' library is available when `gawk' is compiled, it
+ is used by the debugger to provide command-line history and
+ editing.
+
+
+
File: gawk.info, Node: Arbitrary Precision Arithmetic, Next: Dynamic Extensions, Prev: Debugger, Up: Top
15 Arithmetic and Arbitrary Precision Arithmetic with `gawk'
@@ -31792,6 +31930,7 @@ Index
* endgrent() user-defined function: Group Functions. (line 216)
* endpwent() function (C library): Passwd Functions. (line 210)
* endpwent() user-defined function: Passwd Functions. (line 213)
+* English, Steve: Advanced Features. (line 6)
* ENVIRON array: Auto-set. (line 59)
* environment variables used by gawk: Environment Variables.
(line 6)
@@ -32452,6 +32591,7 @@ Index
* l debugger command (alias for list): Miscellaneous Debugger Commands.
(line 72)
* labels.awk program: Labels Program. (line 51)
+* Langston, Peter: Advanced Features. (line 6)
* languages, data-driven: Basic High Level. (line 85)
* Laurie, Dirk: Changing Precision. (line 6)
* LC_ALL locale category: Explaining gettext. (line 121)
@@ -33987,248 +34127,252 @@ Ref: Group Functions-Footnote-1654108
Node: Walking Arrays654321
Node: Library Functions Summary656491
Node: Sample Programs657853
-Node: Running Examples658527
-Node: Clones659255
-Node: Cut Program660479
-Node: Egrep Program670340
-Ref: Egrep Program-Footnote-1678269
-Node: Id Program678379
-Node: Split Program682043
-Ref: Split Program-Footnote-1685574
-Node: Tee Program685702
-Node: Uniq Program688509
-Node: Wc Program695939
-Ref: Wc Program-Footnote-1700207
-Ref: Wc Program-Footnote-2700407
-Node: Miscellaneous Programs700499
-Node: Dupword Program701687
-Node: Alarm Program703718
-Node: Translate Program708532
-Ref: Translate Program-Footnote-1712923
-Ref: Translate Program-Footnote-2713193
-Node: Labels Program713327
-Ref: Labels Program-Footnote-1716698
-Node: Word Sorting716782
-Node: History Sorting720825
-Node: Extract Program722661
-Ref: Extract Program-Footnote-1730236
-Node: Simple Sed730365
-Node: Igawk Program733427
-Ref: Igawk Program-Footnote-1748603
-Ref: Igawk Program-Footnote-2748804
-Node: Anagram Program748942
-Node: Signature Program752010
-Node: Advanced Features753257
-Node: Nondecimal Data755143
-Node: Array Sorting756720
-Node: Controlling Array Traversal757417
-Node: Array Sorting Functions765697
-Ref: Array Sorting Functions-Footnote-1769604
-Node: Two-way I/O769798
-Ref: Two-way I/O-Footnote-1775314
-Node: TCP/IP Networking775396
-Node: Profiling778240
-Node: Internationalization785748
-Node: I18N and L10N787173
-Node: Explaining gettext787859
-Ref: Explaining gettext-Footnote-1792999
-Ref: Explaining gettext-Footnote-2793183
-Node: Programmer i18n793348
-Node: Translator i18n797573
-Node: String Extraction798367
-Ref: String Extraction-Footnote-1799328
-Node: Printf Ordering799414
-Ref: Printf Ordering-Footnote-1802196
-Node: I18N Portability802260
-Ref: I18N Portability-Footnote-1804709
-Node: I18N Example804772
-Ref: I18N Example-Footnote-1807494
-Node: Gawk I18N807566
-Node: Debugger808183
-Node: Debugging809154
-Node: Debugging Concepts809595
-Node: Debugging Terms811451
-Node: Awk Debugging814048
-Node: Sample Debugging Session814940
-Node: Debugger Invocation815460
-Node: Finding The Bug816793
-Node: List of Debugger Commands823275
-Node: Breakpoint Control824607
-Node: Debugger Execution Control828271
-Node: Viewing And Changing Data831631
-Node: Execution Stack834989
-Node: Debugger Info836502
-Node: Miscellaneous Debugger Commands840496
-Node: Readline Support845680
-Node: Limitations846572
-Node: Arbitrary Precision Arithmetic848820
-Ref: Arbitrary Precision Arithmetic-Footnote-1850469
-Node: General Arithmetic850617
-Node: Floating Point Issues852337
-Node: String Conversion Precision853218
-Ref: String Conversion Precision-Footnote-1854923
-Node: Unexpected Results855032
-Node: POSIX Floating Point Problems857185
-Ref: POSIX Floating Point Problems-Footnote-1861006
-Node: Integer Programming861044
-Node: Floating-point Programming862855
-Ref: Floating-point Programming-Footnote-1869183
-Ref: Floating-point Programming-Footnote-2869453
-Node: Floating-point Representation869717
-Node: Floating-point Context870882
-Ref: table-ieee-formats871721
-Node: Rounding Mode873105
-Ref: table-rounding-modes873584
-Ref: Rounding Mode-Footnote-1876599
-Node: Gawk and MPFR876778
-Node: Arbitrary Precision Floats878187
-Ref: Arbitrary Precision Floats-Footnote-1880630
-Node: Setting Precision880951
-Ref: table-predefined-precision-strings881635
-Node: Setting Rounding Mode883780
-Ref: table-gawk-rounding-modes884184
-Node: Floating-point Constants885371
-Node: Changing Precision886823
-Ref: Changing Precision-Footnote-1888215
-Node: Exact Arithmetic888389
-Node: Arbitrary Precision Integers891523
-Ref: Arbitrary Precision Integers-Footnote-1894538
-Node: Dynamic Extensions894685
-Node: Extension Intro896143
-Node: Plugin License897408
-Node: Extension Mechanism Outline898093
-Ref: figure-load-extension898517
-Ref: figure-load-new-function900002
-Ref: figure-call-new-function901004
-Node: Extension API Description902988
-Node: Extension API Functions Introduction904438
-Node: General Data Types909304
-Ref: General Data Types-Footnote-1914997
-Node: Requesting Values915296
-Ref: table-value-types-returned916033
-Node: Memory Allocation Functions916991
-Ref: Memory Allocation Functions-Footnote-1919738
-Node: Constructor Functions919834
-Node: Registration Functions921592
-Node: Extension Functions922277
-Node: Exit Callback Functions924579
-Node: Extension Version String925829
-Node: Input Parsers926479
-Node: Output Wrappers936282
-Node: Two-way processors940798
-Node: Printing Messages943002
-Ref: Printing Messages-Footnote-1944079
-Node: Updating `ERRNO'944231
-Node: Accessing Parameters944970
-Node: Symbol Table Access946200
-Node: Symbol table by name946714
-Node: Symbol table by cookie948690
-Ref: Symbol table by cookie-Footnote-1952823
-Node: Cached values952886
-Ref: Cached values-Footnote-1956391
-Node: Array Manipulation956482
-Ref: Array Manipulation-Footnote-1957580
-Node: Array Data Types957619
-Ref: Array Data Types-Footnote-1960322
-Node: Array Functions960414
-Node: Flattening Arrays964288
-Node: Creating Arrays971140
-Node: Extension API Variables975871
-Node: Extension Versioning976507
-Node: Extension API Informational Variables978408
-Node: Extension API Boilerplate979494
-Node: Finding Extensions983298
-Node: Extension Example983858
-Node: Internal File Description984588
-Node: Internal File Ops988679
-Ref: Internal File Ops-Footnote-11000225
-Node: Using Internal File Ops1000365
-Ref: Using Internal File Ops-Footnote-11002712
-Node: Extension Samples1002980
-Node: Extension Sample File Functions1004504
-Node: Extension Sample Fnmatch1012072
-Node: Extension Sample Fork1013539
-Node: Extension Sample Inplace1014752
-Node: Extension Sample Ord1016518
-Node: Extension Sample Readdir1017354
-Ref: table-readdir-file-types1018203
-Node: Extension Sample Revout1019002
-Node: Extension Sample Rev2way1019593
-Node: Extension Sample Read write array1020334
-Node: Extension Sample Readfile1022213
-Node: Extension Sample API Tests1023313
-Node: Extension Sample Time1023838
-Node: gawkextlib1025153
-Node: Language History1027940
-Node: V7/SVR3.11029534
-Node: SVR41031854
-Node: POSIX1033296
-Node: BTL1034682
-Node: POSIX/GNU1035416
-Node: Feature History1041015
-Node: Common Extensions1054127
-Node: Ranges and Locales1055439
-Ref: Ranges and Locales-Footnote-11060056
-Ref: Ranges and Locales-Footnote-21060083
-Ref: Ranges and Locales-Footnote-31060317
-Node: Contributors1060538
-Node: Installation1065976
-Node: Gawk Distribution1066870
-Node: Getting1067354
-Node: Extracting1068180
-Node: Distribution contents1069822
-Node: Unix Installation1075539
-Node: Quick Installation1076156
-Node: Additional Configuration Options1078598
-Node: Configuration Philosophy1080336
-Node: Non-Unix Installation1082687
-Node: PC Installation1083145
-Node: PC Binary Installation1084456
-Node: PC Compiling1086304
-Ref: PC Compiling-Footnote-11089303
-Node: PC Testing1089408
-Node: PC Using1090584
-Node: Cygwin1094742
-Node: MSYS1095551
-Node: VMS Installation1096065
-Node: VMS Compilation1096861
-Ref: VMS Compilation-Footnote-11098076
-Node: VMS Dynamic Extensions1098134
-Node: VMS Installation Details1099507
-Node: VMS Running1101753
-Node: VMS GNV1104587
-Node: VMS Old Gawk1105310
-Node: Bugs1105780
-Node: Other Versions1109784
-Node: Notes1116009
-Node: Compatibility Mode1116809
-Node: Additions1117591
-Node: Accessing The Source1118516
-Node: Adding Code1119952
-Node: New Ports1126130
-Node: Derived Files1130611
-Ref: Derived Files-Footnote-11135692
-Ref: Derived Files-Footnote-21135726
-Ref: Derived Files-Footnote-31136322
-Node: Future Extensions1136436
-Node: Implementation Limitations1137042
-Node: Extension Design1138290
-Node: Old Extension Problems1139444
-Ref: Old Extension Problems-Footnote-11140961
-Node: Extension New Mechanism Goals1141018
-Ref: Extension New Mechanism Goals-Footnote-11144379
-Node: Extension Other Design Decisions1144568
-Node: Extension Future Growth1146674
-Node: Old Extension Mechanism1147510
-Node: Basic Concepts1149250
-Node: Basic High Level1149931
-Ref: figure-general-flow1150203
-Ref: figure-process-flow1150802
-Ref: Basic High Level-Footnote-11154031
-Node: Basic Data Typing1154216
-Node: Glossary1157543
-Node: Copying1182695
-Node: GNU Free Documentation License1220251
-Node: Index1245387
+Node: Running Examples658580
+Node: Clones659308
+Node: Cut Program660532
+Node: Egrep Program670393
+Ref: Egrep Program-Footnote-1678322
+Node: Id Program678432
+Node: Split Program682096
+Ref: Split Program-Footnote-1685627
+Node: Tee Program685755
+Node: Uniq Program688562
+Node: Wc Program695992
+Ref: Wc Program-Footnote-1700260
+Ref: Wc Program-Footnote-2700460
+Node: Miscellaneous Programs700552
+Node: Dupword Program701765
+Node: Alarm Program703796
+Node: Translate Program708610
+Ref: Translate Program-Footnote-1713001
+Ref: Translate Program-Footnote-2713271
+Node: Labels Program713405
+Ref: Labels Program-Footnote-1716776
+Node: Word Sorting716860
+Node: History Sorting720903
+Node: Extract Program722739
+Ref: Extract Program-Footnote-1730314
+Node: Simple Sed730443
+Node: Igawk Program733505
+Ref: Igawk Program-Footnote-1748681
+Ref: Igawk Program-Footnote-2748882
+Node: Anagram Program749020
+Node: Signature Program752088
+Node: Programs Summary753335
+Node: Advanced Features754523
+Node: Nondecimal Data756471
+Node: Array Sorting758048
+Node: Controlling Array Traversal758745
+Node: Array Sorting Functions767025
+Ref: Array Sorting Functions-Footnote-1770932
+Node: Two-way I/O771126
+Ref: Two-way I/O-Footnote-1776642
+Node: TCP/IP Networking776724
+Node: Profiling779568
+Node: Advanced Features Summary787110
+Node: Internationalization788974
+Node: I18N and L10N790454
+Node: Explaining gettext791140
+Ref: Explaining gettext-Footnote-1796280
+Ref: Explaining gettext-Footnote-2796464
+Node: Programmer i18n796629
+Node: Translator i18n800854
+Node: String Extraction801648
+Ref: String Extraction-Footnote-1802609
+Node: Printf Ordering802695
+Ref: Printf Ordering-Footnote-1805477
+Node: I18N Portability805541
+Ref: I18N Portability-Footnote-1807990
+Node: I18N Example808053
+Ref: I18N Example-Footnote-1810775
+Node: Gawk I18N810847
+Node: I18N Summary811485
+Node: Debugger812824
+Node: Debugging813846
+Node: Debugging Concepts814287
+Node: Debugging Terms816143
+Node: Awk Debugging818740
+Node: Sample Debugging Session819632
+Node: Debugger Invocation820152
+Node: Finding The Bug821485
+Node: List of Debugger Commands827967
+Node: Breakpoint Control829299
+Node: Debugger Execution Control832963
+Node: Viewing And Changing Data836323
+Node: Execution Stack839681
+Node: Debugger Info841194
+Node: Miscellaneous Debugger Commands845188
+Node: Readline Support850372
+Node: Limitations851264
+Node: Debugging Summary853538
+Node: Arbitrary Precision Arithmetic854702
+Ref: Arbitrary Precision Arithmetic-Footnote-1856351
+Node: General Arithmetic856499
+Node: Floating Point Issues858219
+Node: String Conversion Precision859100
+Ref: String Conversion Precision-Footnote-1860805
+Node: Unexpected Results860914
+Node: POSIX Floating Point Problems863067
+Ref: POSIX Floating Point Problems-Footnote-1866888
+Node: Integer Programming866926
+Node: Floating-point Programming868737
+Ref: Floating-point Programming-Footnote-1875065
+Ref: Floating-point Programming-Footnote-2875335
+Node: Floating-point Representation875599
+Node: Floating-point Context876764
+Ref: table-ieee-formats877603
+Node: Rounding Mode878987
+Ref: table-rounding-modes879466
+Ref: Rounding Mode-Footnote-1882481
+Node: Gawk and MPFR882660
+Node: Arbitrary Precision Floats884069
+Ref: Arbitrary Precision Floats-Footnote-1886512
+Node: Setting Precision886833
+Ref: table-predefined-precision-strings887517
+Node: Setting Rounding Mode889662
+Ref: table-gawk-rounding-modes890066
+Node: Floating-point Constants891253
+Node: Changing Precision892705
+Ref: Changing Precision-Footnote-1894097
+Node: Exact Arithmetic894271
+Node: Arbitrary Precision Integers897405
+Ref: Arbitrary Precision Integers-Footnote-1900420
+Node: Dynamic Extensions900567
+Node: Extension Intro902025
+Node: Plugin License903290
+Node: Extension Mechanism Outline903975
+Ref: figure-load-extension904399
+Ref: figure-load-new-function905884
+Ref: figure-call-new-function906886
+Node: Extension API Description908870
+Node: Extension API Functions Introduction910320
+Node: General Data Types915186
+Ref: General Data Types-Footnote-1920879
+Node: Requesting Values921178
+Ref: table-value-types-returned921915
+Node: Memory Allocation Functions922873
+Ref: Memory Allocation Functions-Footnote-1925620
+Node: Constructor Functions925716
+Node: Registration Functions927474
+Node: Extension Functions928159
+Node: Exit Callback Functions930461
+Node: Extension Version String931711
+Node: Input Parsers932361
+Node: Output Wrappers942164
+Node: Two-way processors946680
+Node: Printing Messages948884
+Ref: Printing Messages-Footnote-1949961
+Node: Updating `ERRNO'950113
+Node: Accessing Parameters950852
+Node: Symbol Table Access952082
+Node: Symbol table by name952596
+Node: Symbol table by cookie954572
+Ref: Symbol table by cookie-Footnote-1958705
+Node: Cached values958768
+Ref: Cached values-Footnote-1962273
+Node: Array Manipulation962364
+Ref: Array Manipulation-Footnote-1963462
+Node: Array Data Types963501
+Ref: Array Data Types-Footnote-1966204
+Node: Array Functions966296
+Node: Flattening Arrays970170
+Node: Creating Arrays977022
+Node: Extension API Variables981753
+Node: Extension Versioning982389
+Node: Extension API Informational Variables984290
+Node: Extension API Boilerplate985376
+Node: Finding Extensions989180
+Node: Extension Example989740
+Node: Internal File Description990470
+Node: Internal File Ops994561
+Ref: Internal File Ops-Footnote-11006107
+Node: Using Internal File Ops1006247
+Ref: Using Internal File Ops-Footnote-11008594
+Node: Extension Samples1008862
+Node: Extension Sample File Functions1010386
+Node: Extension Sample Fnmatch1017954
+Node: Extension Sample Fork1019421
+Node: Extension Sample Inplace1020634
+Node: Extension Sample Ord1022400
+Node: Extension Sample Readdir1023236
+Ref: table-readdir-file-types1024085
+Node: Extension Sample Revout1024884
+Node: Extension Sample Rev2way1025475
+Node: Extension Sample Read write array1026216
+Node: Extension Sample Readfile1028095
+Node: Extension Sample API Tests1029195
+Node: Extension Sample Time1029720
+Node: gawkextlib1031035
+Node: Language History1033822
+Node: V7/SVR3.11035416
+Node: SVR41037736
+Node: POSIX1039178
+Node: BTL1040564
+Node: POSIX/GNU1041298
+Node: Feature History1046897
+Node: Common Extensions1060009
+Node: Ranges and Locales1061321
+Ref: Ranges and Locales-Footnote-11065938
+Ref: Ranges and Locales-Footnote-21065965
+Ref: Ranges and Locales-Footnote-31066199
+Node: Contributors1066420
+Node: Installation1071858
+Node: Gawk Distribution1072752
+Node: Getting1073236
+Node: Extracting1074062
+Node: Distribution contents1075704
+Node: Unix Installation1081421
+Node: Quick Installation1082038
+Node: Additional Configuration Options1084480
+Node: Configuration Philosophy1086218
+Node: Non-Unix Installation1088569
+Node: PC Installation1089027
+Node: PC Binary Installation1090338
+Node: PC Compiling1092186
+Ref: PC Compiling-Footnote-11095185
+Node: PC Testing1095290
+Node: PC Using1096466
+Node: Cygwin1100624
+Node: MSYS1101433
+Node: VMS Installation1101947
+Node: VMS Compilation1102743
+Ref: VMS Compilation-Footnote-11103958
+Node: VMS Dynamic Extensions1104016
+Node: VMS Installation Details1105389
+Node: VMS Running1107635
+Node: VMS GNV1110469
+Node: VMS Old Gawk1111192
+Node: Bugs1111662
+Node: Other Versions1115666
+Node: Notes1121891
+Node: Compatibility Mode1122691
+Node: Additions1123473
+Node: Accessing The Source1124398
+Node: Adding Code1125834
+Node: New Ports1132012
+Node: Derived Files1136493
+Ref: Derived Files-Footnote-11141574
+Ref: Derived Files-Footnote-21141608
+Ref: Derived Files-Footnote-31142204
+Node: Future Extensions1142318
+Node: Implementation Limitations1142924
+Node: Extension Design1144172
+Node: Old Extension Problems1145326
+Ref: Old Extension Problems-Footnote-11146843
+Node: Extension New Mechanism Goals1146900
+Ref: Extension New Mechanism Goals-Footnote-11150261
+Node: Extension Other Design Decisions1150450
+Node: Extension Future Growth1152556
+Node: Old Extension Mechanism1153392
+Node: Basic Concepts1155132
+Node: Basic High Level1155813
+Ref: figure-general-flow1156085
+Ref: figure-process-flow1156684
+Ref: Basic High Level-Footnote-11159913
+Node: Basic Data Typing1160098
+Node: Glossary1163425
+Node: Copying1188577
+Node: GNU Free Documentation License1226133
+Node: Index1251269

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 9bac7c58..ba6be294 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -8531,18 +8531,19 @@ The possibilities are as follows:
@command{gawk} sets @code{RT} to the text matched by @code{RS}.
@item
-After splitting the input into records, @command{awk} further splits the record
-into individual fields, named @code{$1}, @code{$2} and so on. @code{$0} is the
-whole record, and @code{NF} indicates how many fields there are. The default way
-to split fields is between whitespace characters.
+After splitting the input into records, @command{awk} further splits
+the record into individual fields, named @code{$1}, @code{$2} and so
+on. @code{$0} is the whole record, and @code{NF} indicates how many
+fields there are. The default way to split fields is between whitespace
+characters.
@item
-Fields may be referenced using a variable, as in @samp{$NF}. Fields may also be
-assigned values, which causes the value of @code{$0} to be recomputed when it is
-later referenced. Assigning to a field with a number greater than @code{NF}
-creates the field and rebuilds the record, using @code{OFS} to separate the fields.
-Incrementing @code{NF} does the same thing. Decrementing @code{NF} throws away fields
-and rebuilds the record.
+Fields may be referenced using a variable, as in @samp{$NF}. Fields
+may also be assigned values, which causes the value of @code{$0} to be
+recomputed when it is later referenced. Assigning to a field with a number
+greater than @code{NF} creates the field and rebuilds the record, using
+@code{OFS} to separate the fields. Incrementing @code{NF} does the same
+thing. Decrementing @code{NF} throws away fields and rebuilds the record.
@item
Field splitting is more complicated than record splitting.
@@ -8557,8 +8558,8 @@ Field splitting is more complicated than record splitting.
@item @code{FPAT == @var{regexp}} @tab On text around text matching the regexp @tab @command{gawk}
@end multitable
-Using @samp{FS = "\n"} causes the entire record to be a single field (assuming
-that newlines separate records).
+Using @samp{FS = "\n"} causes the entire record to be a single field
+(assuming that newlines separate records).
@item
@code{FS} may be set from the command line using the @option{-F} option.
@@ -10116,23 +10117,23 @@ when closing a pipe.
@itemize @value{BULLET}
@item
-The @code{print} statement prints comma-separated expressions. Each expression
-is separated by the value of @code{OFS} and terminated by the value of @code{ORS}.
-@code{OFMT} provides the conversion format for numeric values for the @code{print}
-statement.
+The @code{print} statement prints comma-separated expressions. Each
+expression is separated by the value of @code{OFS} and terminated by
+the value of @code{ORS}. @code{OFMT} provides the conversion format
+for numeric values for the @code{print} statement.
@item
-The @code{printf} statement provides finer-grained control over output, with format
-control letters for different data types and various flags that modify the
-behavior of the format control letters.
+The @code{printf} statement provides finer-grained control over output,
+with format control letters for different data types and various flags
+that modify the behavior of the format control letters.
@item
-Output from both @code{print} and @code{printf} may be redirected to files,
-pipes, and co-processes.
+Output from both @code{print} and @code{printf} may be redirected to
+files, pipes, and co-processes.
@item
-@command{gawk} provides special file names for access to standard input, output
-and error, and for network communications.
+@command{gawk} provides special file names for access to standard input,
+output and error, and for network communications.
@item
Use @code{close()} to close open file, pipe and co-process redirections.
@@ -12569,9 +12570,9 @@ in @ref{Conversion}.
@itemize @value{BULLET}
@item
-Expressions are the basic elements of computation in programs.
-They are built from constants, variables, function calls and combinations
-of the various kinds of values with operators.
+Expressions are the basic elements of computation in programs. They are
+built from constants, variables, function calls and combinations of the
+various kinds of values with operators.
@item
@command{awk} supplies three kinds of constants: numeric, string, and
@@ -12596,8 +12597,8 @@ subtraction, multiplication, division, modulus), and unary plus and minus.
It also provides comparison operators, boolean operators, and regexp
matching operators. String concatenation is accomplished by placing
two expressions next to each other; there is no explicit operator.
-The three-operand @samp{?:} operator provides an ``if-else'' test
-within expressions.
+The three-operand @samp{?:} operator provides an ``if-else'' test within
+expressions.
@item
Assignment operators provide convenient shorthands for common arithmetic
@@ -12608,20 +12609,21 @@ In @command{awk}, a value is considered to be true if it is non-zero
@emph{or} non-null. Otherwise, the value is false.
@item
-A value's type is set upon each assignment and may change over its lifetime.
-The type determines how it behaves in comparisons (string or numeric).
+A value's type is set upon each assignment and may change over its
+lifetime. The type determines how it behaves in comparisons (string
+or numeric).
@item
Function calls return a value which may be used as part of a larger
expression. Expressions used to pass parameter values are fully
evaluated before the function is called. @command{awk} provides
-built-in and user-defined functions; this is described later on in
-this @value{DOCUMENT}.
+built-in and user-defined functions; this is described later on in this
+@value{DOCUMENT}.
@item
-Operator precedence specifies the order in which operations are
-performed, unless explicitly overridden by parentheses. @command{awk}'s
-operator precedence is compatible with that of C.
+Operator precedence specifies the order in which operations are performed,
+unless explicitly overridden by parentheses. @command{awk}'s operator
+precedence is compatible with that of C.
@item
Locales can affect the format of data as output by an @command{awk}
@@ -16320,9 +16322,9 @@ $ @kbd{gawk 'BEGIN @{ b[1][1] = ""; split("a b c d", b[1]); print b[1][1] @}'}
@itemize @value{BULLET}
@item
-Standard @command{awk} provides one-dimensional associative arrays (arrays
-indexed by string values). All arrays are associative; numeric indices
-are converted automatically to strings.
+Standard @command{awk} provides one-dimensional associative arrays
+(arrays indexed by string values). All arrays are associative; numeric
+indices are converted automatically to strings.
@item
Array elements are referenced as @code{@var{array}[@var{indx}]}.
@@ -16338,27 +16340,26 @@ individual elements of an array. In the body of the loop, @var{indx} takes
on the value of each element's index in turn.
@item
-The order in which a
-@samp{for (@var{indx} in @var{array})} loop traverses an array is
-undefined in POSIX @command{awk} and varies among implementations.
-@command{gawk} lets you control the order by assigning special predefined
-values to @code{PROCINFO["sorted_in"]}.
+The order in which a @samp{for (@var{indx} in @var{array})} loop
+traverses an array is undefined in POSIX @command{awk} and varies among
+implementations. @command{gawk} lets you control the order by assigning
+special predefined values to @code{PROCINFO["sorted_in"]}.
@item
-Use @samp{delete @var{array}[@var{indx}]} to delete an
-individual element. You may also use @samp{delete @var{array}}
-to delete all of the elements in the array. This latter feature
-has been a common extension for many years and is now standard, but
-may not be supported by all commercial versions of @command{awk}.
+Use @samp{delete @var{array}[@var{indx}]} to delete an individual element.
+You may also use @samp{delete @var{array}} to delete all of the elements
+in the array. This latter feature has been a common extension for many
+years and is now standard, but may not be supported by all commercial
+versions of @command{awk}.
@item
Standard @command{awk} simulates multidimensional arrays by separating
subscript values with a comma. The values are concatenated into a
-single string, separated by the value of @code{SUBSEP}. The fact that
-such a subscript was created in this way is not retained; thus changing
-@code{SUBSEP} may have unexpected consequences.
-You can use @samp{(@var{sub1}, @var{sub2}, @dots{}) in @var{array}}
-to see if such a multidimensional subscript exists in @var{array}.
+single string, separated by the value of @code{SUBSEP}. The fact
+that such a subscript was created in this way is not retained; thus
+changing @code{SUBSEP} may have unexpected consequences. You can use
+@samp{(@var{sub1}, @var{sub2}, @dots{}) in @var{array}} to see if such
+a multidimensional subscript exists in @var{array}.
@item
@command{gawk} provides true arrays of arrays. You use a separate
@@ -16367,8 +16368,8 @@ set of square brackets for each dimension in such an array:
scalar values (number or string) or another array.
@item
-Use the @code{isarray()} built-in function to determine if an
-array element is itself a subarray.
+Use the @code{isarray()} built-in function to determine if an array
+element is itself a subarray.
@end itemize
@@ -19964,50 +19965,50 @@ for (i = 1; i <= n; i++)
functions.
@item
-POSIX @command{awk} provides three kinds of built-in functions: numeric, string,
-and I/O. @command{gawk} provides functions that work with values
+POSIX @command{awk} provides three kinds of built-in functions: numeric,
+string, and I/O. @command{gawk} provides functions that work with values
representing time, do bit manipulation, sort arrays, and internationalize
-and localize programs.
-@command{gawk} also provides several extensions to some of standard functions,
-typically in the form of additional arguments.
+and localize programs. @command{gawk} also provides several extensions to
+some of standard functions, typically in the form of additional arguments.
@item
-Functions accept zero or more arguments and return a value.
-The expressions that provide the argument values are comnpletely evaluated
+Functions accept zero or more arguments and return a value. The
+expressions that provide the argument values are comnpletely evaluated
before the function is called. Order of evaluation is not defined.
The return value can be ignored.
@item
-The handling of backslash in @code{sub()} and @code{gsub()} is
-not simple. It is more straightforward in @command{gawk}'s @code{gensub()}
-function, but that function still requires care in its use.
+The handling of backslash in @code{sub()} and @code{gsub()} is not simple.
+It is more straightforward in @command{gawk}'s @code{gensub()} function,
+but that function still requires care in its use.
@item
-User-defined functions provide important capabilities but come with some
-syntactic inelegancies. In a function call, there cannot be any space
-between the function name and the opening left parethesis of the argument
-list. Also, there is no provision for local variables, so the convention
-is to add extra parameters, and to separate them visually from the real
-parameters by extra whitespace.
+User-defined functions provide important capabilities but come with
+some syntactic inelegancies. In a function call, there cannot be any
+space between the function name and the opening left parethesis of the
+argument list. Also, there is no provision for local variables, so the
+convention is to add extra parameters, and to separate them visually
+from the real parameters by extra whitespace.
@item
-User-defined functions may call other user-defined (and built-in) functions
-and may call themselves recursively. Function parameters ``hide'' any global
-variables of the same names.
+User-defined functions may call other user-defined (and built-in)
+functions and may call themselves recursively. Function parameters
+``hide'' any global variables of the same names.
@item
-Scalar values are passed to user-defined functions by value. Array parameters
-are passed by reference; any changes made by the function to array parameters
-are thus visible after the function has returned.
+Scalar values are passed to user-defined functions by value. Array
+parameters are passed by reference; any changes made by the function to
+array parameters are thus visible after the function has returned.
@item
Use the @code{return} statement to return from a user-defined function.
-An optional expression becomes the function's return value.
-Only scalar values may be returned by a function.
+An optional expression becomes the function's return value. Only scalar
+values may be returned by a function.
@item
-If a variable that has never been used is passed to a user-defined function,
-how that function treats the variable can set its nature: either scalar or array.
+If a variable that has never been used is passed to a user-defined
+function, how that function treats the variable can set its nature:
+either scalar or array.
@item
@command{gawk} provides indirect function calls using a special syntax.
@@ -22583,9 +22584,9 @@ The functions provided in this @value{CHAPTER} and the next are intended
to serve that purpose.
@item
-When writing general-purpose library functions, put some thought into
-how to name any global variables so that they won't conflict with
-variables from a user's program.
+When writing general-purpose library functions, put some thought into how
+to name any global variables so that they won't conflict with variables
+from a user's program.
@item
The functions presented here fit into the following categories:
@@ -22593,9 +22594,10 @@ The functions presented here fit into the following categories:
@c nested list
@table @asis
@item General problems
-Number to string conversion, assertions, rounding, random number generation,
-converting characters to numbers, joining strings, getting easily usable
-time-of-day information, and reading a whole file in one shot.
+Number to string conversion, assertions, rounding, random number
+generation, converting characters to numbers, joining strings, getting
+easily usable time-of-day information, and reading a whole file in
+one shot.
@item Managing @value{DF}s
Noting @value{DF} boundaries, rereading the current file, checking for
@@ -22631,11 +22633,11 @@ presents the idea that reading programs in a language contributes to
learning that language. This @value{CHAPTER} continues that theme,
presenting a potpourri of @command{awk} programs for your reading
enjoyment.
+@c FULLXREF OFF
@ifnotinfo
There are three sections.
The first describes how to run the programs presented
in this @value{CHAPTER}.
-@c FULLXREF OFF
The second presents @command{awk}
versions of several common POSIX utilities.
@@ -22658,6 +22660,7 @@ Many of these programs use library functions presented in
* Running Examples:: How to run these examples.
* Clones:: Clones of common utilities.
* Miscellaneous Programs:: Some interesting @command{awk} programs.
+* Programs Summary:: Summary of programs.
@end menu
@node Running Examples
@@ -26157,6 +26160,42 @@ BEGIN {
}
@end ignore
+@node Programs Summary
+@section Summary
+
+@itemize @value{BULLET}
+@item
+The functions provided in this @value{CHAPTER} and the previous one
+continue on the theme that reading programs is an excellent way to learn
+Good Programming.
+
+@item
+Using @samp{#!} to make @command{awk} programs directly runnable makes
+them easier to use. Otherwise, invoke the program using @samp{awk
+-f @dots{}}.
+
+@item
+Reimplementing standard POSIX programs in @command{awk} is a pleasant
+exercise; @command{awk}'s expressive power lets you write such programs
+in relatively few lines of code, yet they are functionally complete
+and usable.
+
+@item
+One of standard @command{awk}'s weaknesses is working with individual
+characters. The ability to use @code{split()} with the empty string as
+the separator can considerably simplify such tasks.
+
+@item
+The library functions from @ref{Library Functions}, proved their
+usefulness for a number of real (if small) programs.
+
+@item
+Besides reinventing POSIX wheels, other programs solved a selection of
+interesting problems, such as finding duplicates words in text, printing
+mailing labels, and finding anagrams.
+
+@end itemize
+
@ifnotinfo
@part @value{PART3}Moving Beyond Standard @command{awk} With @command{gawk}
@end ifnotinfo
@@ -26197,6 +26236,8 @@ Contributed by: Peter Langston <pud!psl@bellcore.bellcore.com>
"Write documentation as if whoever reads it is a violent psychopath
who knows where you live."
@end ignore
+@cindex Langston, Peter
+@cindex English, Steve
@quotation
@i{Write documentation as if whoever reads it is
a violent psychopath who knows where you live.}
@@ -26248,6 +26289,7 @@ discusses the ability to dynamically add new built-in functions to
* Two-way I/O:: Two-way communications with another process.
* TCP/IP Networking:: Using @command{gawk} for network programming.
* Profiling:: Profiling your @command{awk} programs.
+* Advanced Features Summary:: Summary of advanced features.
@end menu
@node Nondecimal Data
@@ -27306,11 +27348,56 @@ When called this way, @command{gawk} ``pretty prints'' the program into
The @option{--pretty-print} option still runs your program.
This will change in the next major release.
@end quotation
-@c ENDOFRANGE advgaw
-@c ENDOFRANGE gawadv
@c ENDOFRANGE awkp
@c ENDOFRANGE proawk
+@node Advanced Features Summary
+@section Summary
+
+@itemize @value{BULLET}
+@item
+The @option{--non-decimal-data} option causes @command{gawk} to treat
+octal- and hexadecimal-looking input data as octal and hexadecimal.
+This option should be used with caution or not at all; use of @code{strtonum()}
+is preferable.
+
+@item
+You can take over complete control of sorting in @samp{for (@var{indx} in @var{array})}
+array traversal by setting @code{PROCINFO["sorted_in"]} to the name of a user-defined
+function that does the comparison of array elements based on index and value.
+
+@item
+Similarly, you can supply the name of a user-defined comparison function as the
+third argument to either @code{asort()} or @command{asorti()} to control how
+those functions sort arrays. Or you may provide one of the predefined control
+strings that work for @code{PROCINFO["sorted_in"]}.
+
+@item
+You can use the @samp{|&} operator to create a two-way pipe to a co-process.
+You read from the co-process with @code{getline} and write to it with @code{print}
+or @code{printf}. Use @code{close()} to close off the co-process completely, or
+optionally, close off one side of the two-way communications.
+
+@item
+By using special ``@value{FN}s'' with the @samp{|&} operator, you can open a
+TCP/IP (or UDP/IP) connection to remote hosts in the Internet. @command{gawk}
+supports both IPv4 an IPv6.
+
+@item
+You can generate statement count profiles of your program. This can help you
+determine which parts of your program may be taking the most time and let
+you tune them more easily. Sending the @code{USR1} signal while profiling causes
+@command{gawk} to dump the profile and keep going, including a function call stack.
+
+@item
+You can also just ``pretty print'' the program. This currently also runs
+the program, but that will change in the next major release.
+
+@end itemize
+
+@c ENDOFRANGE advgaw
+@c ENDOFRANGE gawadv
+
@node Internationalization
@chapter Internationalization with @command{gawk}
@@ -27344,6 +27431,7 @@ a requirement.
* Translator i18n:: Features for the translator.
* I18N Example:: A simple i18n example.
* Gawk I18N:: @command{gawk} is also internationalized.
+* I18N Summary:: Summary of I18N stuff.
@end menu
@node I18N and L10N
@@ -28106,15 +28194,54 @@ As of this writing, the latest version of GNU @command{gettext} is
If a translation of @command{gawk}'s messages exists,
then @command{gawk} produces usage messages, warnings,
and fatal errors in the local language.
-@c ENDOFRANGE inloc
-@c The original text for this chapter was contributed by Efraim Yawitz.
-@c FIXME: Add more indexing.
+@node I18N Summary
+@section Summary
+
+@itemize @value{BULLET}
+@item
+Internationalization means writing a program such that it can use multiple
+languages without requiring source-code changes. Localization means
+providing the data necessary for an internationalized program to work
+in a particular language.
+
+@item
+@command{gawk} uses GNU @command{gettext} to let you internationalize
+and localize @command{awk} programs. A program's text domain identifies
+the program for grouping all messages and other data together.
+
+@item
+You mark a program's strings for translation by preceding them with
+an underscore. Once that is done, the strings are extracted into a
+@file{.pot} file. This file is copied for each langauge into a @file{.po}
+file, and the @file{.po} files are compiled into @file{.gmo} files for
+use at runtime.
+
+@item
+You can use position specifications with @code{sprintf()} and
+@code{printf} to rearrange the placement of argument values in formatted
+strings and output. This is useful for the translations of format
+control strings.
+
+@item
+The internationalization features have been designed so that they
+can be easily worked around in a standard @command{awk}.
+
+@item
+@command{gawk} itself has been internationalized and ships with
+a number of translations for its messages.
+
+@end itemize
+
+@c ENDOFRANGE inloc
@node Debugger
@chapter Debugging @command{awk} Programs
@cindex debugging @command{awk} programs
+@c The original text for this chapter was contributed by Efraim Yawitz.
+@c FIXME: Add more indexing.
+
It would be nice if computer programs worked perfectly the first time they
were run, but in real life, this rarely happens for programs of
any complexity. Thus, most programming languages have facilities available
@@ -28131,6 +28258,7 @@ how to use @command{gawk} for debugging your program is easy.
* List of Debugger Commands:: Main debugger commands.
* Readline Support:: Readline support.
* Limitations:: Limitations and future plans.
+* Debugging Summary:: Debugging summary.
@end menu
@node Debugging
@@ -29409,6 +29537,39 @@ The @command{gawk} debugger only accepts source supplied with the @option{-f} op
Look forward to a future release when these and other missing features may
be added, and of course feel free to try to add them yourself!
+@node Debugging Summary
+@section Summary
+
+@itemize @value{BULLET}
+@item
+Programs rarely work correctly the first time. Finding bugs
+is @dfn{debugging} and a program that helps you find bugs is a
+@dfn{debugger}. @command{gawk} has a built-in debugger that works very
+similarly to the GNU Debugger, GDB.
+
+@item
+Debuggers let you step through your program one statement at a time,
+examine and change variable and array values, and do a number of other
+things that let understand what your program is actually doing (as
+opposed to what it is supposed to do).
+
+@item
+Like most debuggers, the @command{gawk} debugger works in terms of stack
+frames, and lets you set both breakpoints (stop at a point in the code)
+and watchpoints (stop when a data value changes).
+
+@item
+The debugger command set is fairly complete, providing control over
+breakpoints, execution, viewing and changing data, working with the stack,
+getting information, and other tasks.
+
+@item
+If the @code{readline} library is available when @command{gawk} is
+compiled, it is used by the debugger to provide command-line history
+and editing.
+
+@end itemize
+
@node Arbitrary Precision Arithmetic
@chapter Arithmetic and Arbitrary Precision Arithmetic with @command{gawk}
@cindex arbitrary precision
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 14638c5e..4efad7eb 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -8150,18 +8150,19 @@ The possibilities are as follows:
@command{gawk} sets @code{RT} to the text matched by @code{RS}.
@item
-After splitting the input into records, @command{awk} further splits the record
-into individual fields, named @code{$1}, @code{$2} and so on. @code{$0} is the
-whole record, and @code{NF} indicates how many fields there are. The default way
-to split fields is between whitespace characters.
+After splitting the input into records, @command{awk} further splits
+the record into individual fields, named @code{$1}, @code{$2} and so
+on. @code{$0} is the whole record, and @code{NF} indicates how many
+fields there are. The default way to split fields is between whitespace
+characters.
@item
-Fields may be referenced using a variable, as in @samp{$NF}. Fields may also be
-assigned values, which causes the value of @code{$0} to be recomputed when it is
-later referenced. Assigning to a field with a number greater than @code{NF}
-creates the field and rebuilds the record, using @code{OFS} to separate the fields.
-Incrementing @code{NF} does the same thing. Decrementing @code{NF} throws away fields
-and rebuilds the record.
+Fields may be referenced using a variable, as in @samp{$NF}. Fields
+may also be assigned values, which causes the value of @code{$0} to be
+recomputed when it is later referenced. Assigning to a field with a number
+greater than @code{NF} creates the field and rebuilds the record, using
+@code{OFS} to separate the fields. Incrementing @code{NF} does the same
+thing. Decrementing @code{NF} throws away fields and rebuilds the record.
@item
Field splitting is more complicated than record splitting.
@@ -8176,8 +8177,8 @@ Field splitting is more complicated than record splitting.
@item @code{FPAT == @var{regexp}} @tab On text around text matching the regexp @tab @command{gawk}
@end multitable
-Using @samp{FS = "\n"} causes the entire record to be a single field (assuming
-that newlines separate records).
+Using @samp{FS = "\n"} causes the entire record to be a single field
+(assuming that newlines separate records).
@item
@code{FS} may be set from the command line using the @option{-F} option.
@@ -9635,23 +9636,23 @@ when closing a pipe.
@itemize @value{BULLET}
@item
-The @code{print} statement prints comma-separated expressions. Each expression
-is separated by the value of @code{OFS} and terminated by the value of @code{ORS}.
-@code{OFMT} provides the conversion format for numeric values for the @code{print}
-statement.
+The @code{print} statement prints comma-separated expressions. Each
+expression is separated by the value of @code{OFS} and terminated by
+the value of @code{ORS}. @code{OFMT} provides the conversion format
+for numeric values for the @code{print} statement.
@item
-The @code{printf} statement provides finer-grained control over output, with format
-control letters for different data types and various flags that modify the
-behavior of the format control letters.
+The @code{printf} statement provides finer-grained control over output,
+with format control letters for different data types and various flags
+that modify the behavior of the format control letters.
@item
-Output from both @code{print} and @code{printf} may be redirected to files,
-pipes, and co-processes.
+Output from both @code{print} and @code{printf} may be redirected to
+files, pipes, and co-processes.
@item
-@command{gawk} provides special file names for access to standard input, output
-and error, and for network communications.
+@command{gawk} provides special file names for access to standard input,
+output and error, and for network communications.
@item
Use @code{close()} to close open file, pipe and co-process redirections.
@@ -11949,9 +11950,9 @@ in @ref{Conversion}.
@itemize @value{BULLET}
@item
-Expressions are the basic elements of computation in programs.
-They are built from constants, variables, function calls and combinations
-of the various kinds of values with operators.
+Expressions are the basic elements of computation in programs. They are
+built from constants, variables, function calls and combinations of the
+various kinds of values with operators.
@item
@command{awk} supplies three kinds of constants: numeric, string, and
@@ -11976,8 +11977,8 @@ subtraction, multiplication, division, modulus), and unary plus and minus.
It also provides comparison operators, boolean operators, and regexp
matching operators. String concatenation is accomplished by placing
two expressions next to each other; there is no explicit operator.
-The three-operand @samp{?:} operator provides an ``if-else'' test
-within expressions.
+The three-operand @samp{?:} operator provides an ``if-else'' test within
+expressions.
@item
Assignment operators provide convenient shorthands for common arithmetic
@@ -11988,20 +11989,21 @@ In @command{awk}, a value is considered to be true if it is non-zero
@emph{or} non-null. Otherwise, the value is false.
@item
-A value's type is set upon each assignment and may change over its lifetime.
-The type determines how it behaves in comparisons (string or numeric).
+A value's type is set upon each assignment and may change over its
+lifetime. The type determines how it behaves in comparisons (string
+or numeric).
@item
Function calls return a value which may be used as part of a larger
expression. Expressions used to pass parameter values are fully
evaluated before the function is called. @command{awk} provides
-built-in and user-defined functions; this is described later on in
-this @value{DOCUMENT}.
+built-in and user-defined functions; this is described later on in this
+@value{DOCUMENT}.
@item
-Operator precedence specifies the order in which operations are
-performed, unless explicitly overridden by parentheses. @command{awk}'s
-operator precedence is compatible with that of C.
+Operator precedence specifies the order in which operations are performed,
+unless explicitly overridden by parentheses. @command{awk}'s operator
+precedence is compatible with that of C.
@item
Locales can affect the format of data as output by an @command{awk}
@@ -15654,9 +15656,9 @@ $ @kbd{gawk 'BEGIN @{ b[1][1] = ""; split("a b c d", b[1]); print b[1][1] @}'}
@itemize @value{BULLET}
@item
-Standard @command{awk} provides one-dimensional associative arrays (arrays
-indexed by string values). All arrays are associative; numeric indices
-are converted automatically to strings.
+Standard @command{awk} provides one-dimensional associative arrays
+(arrays indexed by string values). All arrays are associative; numeric
+indices are converted automatically to strings.
@item
Array elements are referenced as @code{@var{array}[@var{indx}]}.
@@ -15672,27 +15674,26 @@ individual elements of an array. In the body of the loop, @var{indx} takes
on the value of each element's index in turn.
@item
-The order in which a
-@samp{for (@var{indx} in @var{array})} loop traverses an array is
-undefined in POSIX @command{awk} and varies among implementations.
-@command{gawk} lets you control the order by assigning special predefined
-values to @code{PROCINFO["sorted_in"]}.
+The order in which a @samp{for (@var{indx} in @var{array})} loop
+traverses an array is undefined in POSIX @command{awk} and varies among
+implementations. @command{gawk} lets you control the order by assigning
+special predefined values to @code{PROCINFO["sorted_in"]}.
@item
-Use @samp{delete @var{array}[@var{indx}]} to delete an
-individual element. You may also use @samp{delete @var{array}}
-to delete all of the elements in the array. This latter feature
-has been a common extension for many years and is now standard, but
-may not be supported by all commercial versions of @command{awk}.
+Use @samp{delete @var{array}[@var{indx}]} to delete an individual element.
+You may also use @samp{delete @var{array}} to delete all of the elements
+in the array. This latter feature has been a common extension for many
+years and is now standard, but may not be supported by all commercial
+versions of @command{awk}.
@item
Standard @command{awk} simulates multidimensional arrays by separating
subscript values with a comma. The values are concatenated into a
-single string, separated by the value of @code{SUBSEP}. The fact that
-such a subscript was created in this way is not retained; thus changing
-@code{SUBSEP} may have unexpected consequences.
-You can use @samp{(@var{sub1}, @var{sub2}, @dots{}) in @var{array}}
-to see if such a multidimensional subscript exists in @var{array}.
+single string, separated by the value of @code{SUBSEP}. The fact
+that such a subscript was created in this way is not retained; thus
+changing @code{SUBSEP} may have unexpected consequences. You can use
+@samp{(@var{sub1}, @var{sub2}, @dots{}) in @var{array}} to see if such
+a multidimensional subscript exists in @var{array}.
@item
@command{gawk} provides true arrays of arrays. You use a separate
@@ -15701,8 +15702,8 @@ set of square brackets for each dimension in such an array:
scalar values (number or string) or another array.
@item
-Use the @code{isarray()} built-in function to determine if an
-array element is itself a subarray.
+Use the @code{isarray()} built-in function to determine if an array
+element is itself a subarray.
@end itemize
@@ -19137,50 +19138,50 @@ for (i = 1; i <= n; i++)
functions.
@item
-POSIX @command{awk} provides three kinds of built-in functions: numeric, string,
-and I/O. @command{gawk} provides functions that work with values
+POSIX @command{awk} provides three kinds of built-in functions: numeric,
+string, and I/O. @command{gawk} provides functions that work with values
representing time, do bit manipulation, sort arrays, and internationalize
-and localize programs.
-@command{gawk} also provides several extensions to some of standard functions,
-typically in the form of additional arguments.
+and localize programs. @command{gawk} also provides several extensions to
+some of standard functions, typically in the form of additional arguments.
@item
-Functions accept zero or more arguments and return a value.
-The expressions that provide the argument values are comnpletely evaluated
+Functions accept zero or more arguments and return a value. The
+expressions that provide the argument values are comnpletely evaluated
before the function is called. Order of evaluation is not defined.
The return value can be ignored.
@item
-The handling of backslash in @code{sub()} and @code{gsub()} is
-not simple. It is more straightforward in @command{gawk}'s @code{gensub()}
-function, but that function still requires care in its use.
+The handling of backslash in @code{sub()} and @code{gsub()} is not simple.
+It is more straightforward in @command{gawk}'s @code{gensub()} function,
+but that function still requires care in its use.
@item
-User-defined functions provide important capabilities but come with some
-syntactic inelegancies. In a function call, there cannot be any space
-between the function name and the opening left parethesis of the argument
-list. Also, there is no provision for local variables, so the convention
-is to add extra parameters, and to separate them visually from the real
-parameters by extra whitespace.
+User-defined functions provide important capabilities but come with
+some syntactic inelegancies. In a function call, there cannot be any
+space between the function name and the opening left parethesis of the
+argument list. Also, there is no provision for local variables, so the
+convention is to add extra parameters, and to separate them visually
+from the real parameters by extra whitespace.
@item
-User-defined functions may call other user-defined (and built-in) functions
-and may call themselves recursively. Function parameters ``hide'' any global
-variables of the same names.
+User-defined functions may call other user-defined (and built-in)
+functions and may call themselves recursively. Function parameters
+``hide'' any global variables of the same names.
@item
-Scalar values are passed to user-defined functions by value. Array parameters
-are passed by reference; any changes made by the function to array parameters
-are thus visible after the function has returned.
+Scalar values are passed to user-defined functions by value. Array
+parameters are passed by reference; any changes made by the function to
+array parameters are thus visible after the function has returned.
@item
Use the @code{return} statement to return from a user-defined function.
-An optional expression becomes the function's return value.
-Only scalar values may be returned by a function.
+An optional expression becomes the function's return value. Only scalar
+values may be returned by a function.
@item
-If a variable that has never been used is passed to a user-defined function,
-how that function treats the variable can set its nature: either scalar or array.
+If a variable that has never been used is passed to a user-defined
+function, how that function treats the variable can set its nature:
+either scalar or array.
@item
@command{gawk} provides indirect function calls using a special syntax.
@@ -21727,9 +21728,9 @@ The functions provided in this @value{CHAPTER} and the next are intended
to serve that purpose.
@item
-When writing general-purpose library functions, put some thought into
-how to name any global variables so that they won't conflict with
-variables from a user's program.
+When writing general-purpose library functions, put some thought into how
+to name any global variables so that they won't conflict with variables
+from a user's program.
@item
The functions presented here fit into the following categories:
@@ -21737,9 +21738,10 @@ The functions presented here fit into the following categories:
@c nested list
@table @asis
@item General problems
-Number to string conversion, assertions, rounding, random number generation,
-converting characters to numbers, joining strings, getting easily usable
-time-of-day information, and reading a whole file in one shot.
+Number to string conversion, assertions, rounding, random number
+generation, converting characters to numbers, joining strings, getting
+easily usable time-of-day information, and reading a whole file in
+one shot.
@item Managing @value{DF}s
Noting @value{DF} boundaries, rereading the current file, checking for
@@ -21775,11 +21777,11 @@ presents the idea that reading programs in a language contributes to
learning that language. This @value{CHAPTER} continues that theme,
presenting a potpourri of @command{awk} programs for your reading
enjoyment.
+@c FULLXREF OFF
@ifnotinfo
There are three sections.
The first describes how to run the programs presented
in this @value{CHAPTER}.
-@c FULLXREF OFF
The second presents @command{awk}
versions of several common POSIX utilities.
@@ -21802,6 +21804,7 @@ Many of these programs use library functions presented in
* Running Examples:: How to run these examples.
* Clones:: Clones of common utilities.
* Miscellaneous Programs:: Some interesting @command{awk} programs.
+* Programs Summary:: Summary of programs.
@end menu
@node Running Examples
@@ -25301,6 +25304,42 @@ BEGIN {
}
@end ignore
+@node Programs Summary
+@section Summary
+
+@itemize @value{BULLET}
+@item
+The functions provided in this @value{CHAPTER} and the previous one
+continue on the theme that reading programs is an excellent way to learn
+Good Programming.
+
+@item
+Using @samp{#!} to make @command{awk} programs directly runnable makes
+them easier to use. Otherwise, invoke the program using @samp{awk
+-f @dots{}}.
+
+@item
+Reimplementing standard POSIX programs in @command{awk} is a pleasant
+exercise; @command{awk}'s expressive power lets you write such programs
+in relatively few lines of code, yet they are functionally complete
+and usable.
+
+@item
+One of standard @command{awk}'s weaknesses is working with individual
+characters. The ability to use @code{split()} with the empty string as
+the separator can considerably simplify such tasks.
+
+@item
+The library functions from @ref{Library Functions}, proved their
+usefulness for a number of real (if small) programs.
+
+@item
+Besides reinventing POSIX wheels, other programs solved a selection of
+interesting problems, such as finding duplicates words in text, printing
+mailing labels, and finding anagrams.
+
+@end itemize
+
@ifnotinfo
@part @value{PART3}Moving Beyond Standard @command{awk} With @command{gawk}
@end ifnotinfo
@@ -25341,6 +25380,8 @@ Contributed by: Peter Langston <pud!psl@bellcore.bellcore.com>
"Write documentation as if whoever reads it is a violent psychopath
who knows where you live."
@end ignore
+@cindex Langston, Peter
+@cindex English, Steve
@quotation
@i{Write documentation as if whoever reads it is
a violent psychopath who knows where you live.}
@@ -25392,6 +25433,7 @@ discusses the ability to dynamically add new built-in functions to
* Two-way I/O:: Two-way communications with another process.
* TCP/IP Networking:: Using @command{gawk} for network programming.
* Profiling:: Profiling your @command{awk} programs.
+* Advanced Features Summary:: Summary of advanced features.
@end menu
@node Nondecimal Data
@@ -26450,11 +26492,56 @@ When called this way, @command{gawk} ``pretty prints'' the program into
The @option{--pretty-print} option still runs your program.
This will change in the next major release.
@end quotation
-@c ENDOFRANGE advgaw
-@c ENDOFRANGE gawadv
@c ENDOFRANGE awkp
@c ENDOFRANGE proawk
+@node Advanced Features Summary
+@section Summary
+
+@itemize @value{BULLET}
+@item
+The @option{--non-decimal-data} option causes @command{gawk} to treat
+octal- and hexadecimal-looking input data as octal and hexadecimal.
+This option should be used with caution or not at all; use of @code{strtonum()}
+is preferable.
+
+@item
+You can take over complete control of sorting in @samp{for (@var{indx} in @var{array})}
+array traversal by setting @code{PROCINFO["sorted_in"]} to the name of a user-defined
+function that does the comparison of array elements based on index and value.
+
+@item
+Similarly, you can supply the name of a user-defined comparison function as the
+third argument to either @code{asort()} or @command{asorti()} to control how
+those functions sort arrays. Or you may provide one of the predefined control
+strings that work for @code{PROCINFO["sorted_in"]}.
+
+@item
+You can use the @samp{|&} operator to create a two-way pipe to a co-process.
+You read from the co-process with @code{getline} and write to it with @code{print}
+or @code{printf}. Use @code{close()} to close off the co-process completely, or
+optionally, close off one side of the two-way communications.
+
+@item
+By using special ``@value{FN}s'' with the @samp{|&} operator, you can open a
+TCP/IP (or UDP/IP) connection to remote hosts in the Internet. @command{gawk}
+supports both IPv4 an IPv6.
+
+@item
+You can generate statement count profiles of your program. This can help you
+determine which parts of your program may be taking the most time and let
+you tune them more easily. Sending the @code{USR1} signal while profiling causes
+@command{gawk} to dump the profile and keep going, including a function call stack.
+
+@item
+You can also just ``pretty print'' the program. This currently also runs
+the program, but that will change in the next major release.
+
+@end itemize
+
+@c ENDOFRANGE advgaw
+@c ENDOFRANGE gawadv
+
@node Internationalization
@chapter Internationalization with @command{gawk}
@@ -26488,6 +26575,7 @@ a requirement.
* Translator i18n:: Features for the translator.
* I18N Example:: A simple i18n example.
* Gawk I18N:: @command{gawk} is also internationalized.
+* I18N Summary:: Summary of I18N stuff.
@end menu
@node I18N and L10N
@@ -27250,15 +27338,54 @@ As of this writing, the latest version of GNU @command{gettext} is
If a translation of @command{gawk}'s messages exists,
then @command{gawk} produces usage messages, warnings,
and fatal errors in the local language.
-@c ENDOFRANGE inloc
-@c The original text for this chapter was contributed by Efraim Yawitz.
-@c FIXME: Add more indexing.
+@node I18N Summary
+@section Summary
+
+@itemize @value{BULLET}
+@item
+Internationalization means writing a program such that it can use multiple
+languages without requiring source-code changes. Localization means
+providing the data necessary for an internationalized program to work
+in a particular language.
+
+@item
+@command{gawk} uses GNU @command{gettext} to let you internationalize
+and localize @command{awk} programs. A program's text domain identifies
+the program for grouping all messages and other data together.
+
+@item
+You mark a program's strings for translation by preceding them with
+an underscore. Once that is done, the strings are extracted into a
+@file{.pot} file. This file is copied for each langauge into a @file{.po}
+file, and the @file{.po} files are compiled into @file{.gmo} files for
+use at runtime.
+
+@item
+You can use position specifications with @code{sprintf()} and
+@code{printf} to rearrange the placement of argument values in formatted
+strings and output. This is useful for the translations of format
+control strings.
+
+@item
+The internationalization features have been designed so that they
+can be easily worked around in a standard @command{awk}.
+
+@item
+@command{gawk} itself has been internationalized and ships with
+a number of translations for its messages.
+
+@end itemize
+
+@c ENDOFRANGE inloc
@node Debugger
@chapter Debugging @command{awk} Programs
@cindex debugging @command{awk} programs
+@c The original text for this chapter was contributed by Efraim Yawitz.
+@c FIXME: Add more indexing.
+
It would be nice if computer programs worked perfectly the first time they
were run, but in real life, this rarely happens for programs of
any complexity. Thus, most programming languages have facilities available
@@ -27275,6 +27402,7 @@ how to use @command{gawk} for debugging your program is easy.
* List of Debugger Commands:: Main debugger commands.
* Readline Support:: Readline support.
* Limitations:: Limitations and future plans.
+* Debugging Summary:: Debugging summary.
@end menu
@node Debugging
@@ -28553,6 +28681,39 @@ The @command{gawk} debugger only accepts source supplied with the @option{-f} op
Look forward to a future release when these and other missing features may
be added, and of course feel free to try to add them yourself!
+@node Debugging Summary
+@section Summary
+
+@itemize @value{BULLET}
+@item
+Programs rarely work correctly the first time. Finding bugs
+is @dfn{debugging} and a program that helps you find bugs is a
+@dfn{debugger}. @command{gawk} has a built-in debugger that works very
+similarly to the GNU Debugger, GDB.
+
+@item
+Debuggers let you step through your program one statement at a time,
+examine and change variable and array values, and do a number of other
+things that let understand what your program is actually doing (as
+opposed to what it is supposed to do).
+
+@item
+Like most debuggers, the @command{gawk} debugger works in terms of stack
+frames, and lets you set both breakpoints (stop at a point in the code)
+and watchpoints (stop when a data value changes).
+
+@item
+The debugger command set is fairly complete, providing control over
+breakpoints, execution, viewing and changing data, working with the stack,
+getting information, and other tasks.
+
+@item
+If the @code{readline} library is available when @command{gawk} is
+compiled, it is used by the debugger to provide command-line history
+and editing.
+
+@end itemize
+
@node Arbitrary Precision Arithmetic
@chapter Arithmetic and Arbitrary Precision Arithmetic with @command{gawk}
@cindex arbitrary precision