aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-06-12 22:01:31 +0300
committerArnold D. Robbins <arnold@skeeve.com>2014-06-12 22:01:31 +0300
commit4a42ca2e31b40f0d46634f9ab77d82e4fe727c22 (patch)
tree7370ab418318f93b6d101364e902f469f33a656f
parentb6c937359a778e40a5d532c2a3aed8b21b89b3be (diff)
downloadegawk-4a42ca2e31b40f0d46634f9ab77d82e4fe727c22.tar.gz
egawk-4a42ca2e31b40f0d46634f9ab77d82e4fe727c22.tar.bz2
egawk-4a42ca2e31b40f0d46634f9ab77d82e4fe727c22.zip
And more summaries in the doc.
-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 bb9d4f29..f81579ac 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 ff50955b..9033128e 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -14014,9 +14014,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
@@ -14036,8 +14036,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
@@ -15953,6 +15953,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
@@ -17168,7 +17169,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
=================================
@@ -18564,6 +18565,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'
@@ -18607,6 +18638,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
@@ -19209,7 +19241,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
==================================
@@ -19438,6 +19470,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'
@@ -19467,6 +19541,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
@@ -20005,7 +20080,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
===================================
@@ -20020,6 +20095,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
@@ -20042,6 +20150,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
@@ -21020,7 +21129,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
=================================
@@ -21067,6 +21176,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'
@@ -31784,6 +31922,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)
@@ -32444,6 +32583,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)
@@ -33979,248 +34119,252 @@ Ref: Group Functions-Footnote-1653771
Node: Walking Arrays653984
Node: Library Functions Summary656154
Node: Sample Programs657516
-Node: Running Examples658190
-Node: Clones658918
-Node: Cut Program660142
-Node: Egrep Program670003
-Ref: Egrep Program-Footnote-1677932
-Node: Id Program678042
-Node: Split Program681706
-Ref: Split Program-Footnote-1685237
-Node: Tee Program685365
-Node: Uniq Program688172
-Node: Wc Program695602
-Ref: Wc Program-Footnote-1699870
-Ref: Wc Program-Footnote-2700070
-Node: Miscellaneous Programs700162
-Node: Dupword Program701350
-Node: Alarm Program703381
-Node: Translate Program708195
-Ref: Translate Program-Footnote-1712586
-Ref: Translate Program-Footnote-2712856
-Node: Labels Program712990
-Ref: Labels Program-Footnote-1716361
-Node: Word Sorting716445
-Node: History Sorting720488
-Node: Extract Program722324
-Ref: Extract Program-Footnote-1729899
-Node: Simple Sed730028
-Node: Igawk Program733090
-Ref: Igawk Program-Footnote-1748266
-Ref: Igawk Program-Footnote-2748467
-Node: Anagram Program748605
-Node: Signature Program751673
-Node: Advanced Features752920
-Node: Nondecimal Data754806
-Node: Array Sorting756383
-Node: Controlling Array Traversal757080
-Node: Array Sorting Functions765360
-Ref: Array Sorting Functions-Footnote-1769267
-Node: Two-way I/O769461
-Ref: Two-way I/O-Footnote-1774977
-Node: TCP/IP Networking775059
-Node: Profiling777903
-Node: Internationalization785411
-Node: I18N and L10N786836
-Node: Explaining gettext787522
-Ref: Explaining gettext-Footnote-1792662
-Ref: Explaining gettext-Footnote-2792846
-Node: Programmer i18n793011
-Node: Translator i18n797236
-Node: String Extraction798030
-Ref: String Extraction-Footnote-1798991
-Node: Printf Ordering799077
-Ref: Printf Ordering-Footnote-1801859
-Node: I18N Portability801923
-Ref: I18N Portability-Footnote-1804372
-Node: I18N Example804435
-Ref: I18N Example-Footnote-1807157
-Node: Gawk I18N807229
-Node: Debugger807846
-Node: Debugging808817
-Node: Debugging Concepts809258
-Node: Debugging Terms811114
-Node: Awk Debugging813711
-Node: Sample Debugging Session814603
-Node: Debugger Invocation815123
-Node: Finding The Bug816456
-Node: List of Debugger Commands822938
-Node: Breakpoint Control824270
-Node: Debugger Execution Control827934
-Node: Viewing And Changing Data831294
-Node: Execution Stack834652
-Node: Debugger Info836165
-Node: Miscellaneous Debugger Commands840159
-Node: Readline Support845343
-Node: Limitations846235
-Node: Arbitrary Precision Arithmetic848483
-Ref: Arbitrary Precision Arithmetic-Footnote-1850132
-Node: General Arithmetic850280
-Node: Floating Point Issues852000
-Node: String Conversion Precision852881
-Ref: String Conversion Precision-Footnote-1854586
-Node: Unexpected Results854695
-Node: POSIX Floating Point Problems856848
-Ref: POSIX Floating Point Problems-Footnote-1860669
-Node: Integer Programming860707
-Node: Floating-point Programming862518
-Ref: Floating-point Programming-Footnote-1868846
-Ref: Floating-point Programming-Footnote-2869116
-Node: Floating-point Representation869380
-Node: Floating-point Context870545
-Ref: table-ieee-formats871384
-Node: Rounding Mode872768
-Ref: table-rounding-modes873247
-Ref: Rounding Mode-Footnote-1876262
-Node: Gawk and MPFR876441
-Node: Arbitrary Precision Floats877850
-Ref: Arbitrary Precision Floats-Footnote-1880293
-Node: Setting Precision880614
-Ref: table-predefined-precision-strings881298
-Node: Setting Rounding Mode883443
-Ref: table-gawk-rounding-modes883847
-Node: Floating-point Constants885034
-Node: Changing Precision886486
-Ref: Changing Precision-Footnote-1887878
-Node: Exact Arithmetic888052
-Node: Arbitrary Precision Integers891186
-Ref: Arbitrary Precision Integers-Footnote-1894201
-Node: Dynamic Extensions894348
-Node: Extension Intro895806
-Node: Plugin License897071
-Node: Extension Mechanism Outline897756
-Ref: figure-load-extension898180
-Ref: figure-load-new-function899665
-Ref: figure-call-new-function900667
-Node: Extension API Description902651
-Node: Extension API Functions Introduction904101
-Node: General Data Types908967
-Ref: General Data Types-Footnote-1914660
-Node: Requesting Values914959
-Ref: table-value-types-returned915696
-Node: Memory Allocation Functions916654
-Ref: Memory Allocation Functions-Footnote-1919401
-Node: Constructor Functions919497
-Node: Registration Functions921255
-Node: Extension Functions921940
-Node: Exit Callback Functions924242
-Node: Extension Version String925492
-Node: Input Parsers926142
-Node: Output Wrappers935945
-Node: Two-way processors940461
-Node: Printing Messages942665
-Ref: Printing Messages-Footnote-1943742
-Node: Updating `ERRNO'943894
-Node: Accessing Parameters944633
-Node: Symbol Table Access945863
-Node: Symbol table by name946377
-Node: Symbol table by cookie948353
-Ref: Symbol table by cookie-Footnote-1952486
-Node: Cached values952549
-Ref: Cached values-Footnote-1956054
-Node: Array Manipulation956145
-Ref: Array Manipulation-Footnote-1957243
-Node: Array Data Types957282
-Ref: Array Data Types-Footnote-1959985
-Node: Array Functions960077
-Node: Flattening Arrays963951
-Node: Creating Arrays970803
-Node: Extension API Variables975534
-Node: Extension Versioning976170
-Node: Extension API Informational Variables978071
-Node: Extension API Boilerplate979157
-Node: Finding Extensions982961
-Node: Extension Example983521
-Node: Internal File Description984251
-Node: Internal File Ops988342
-Ref: Internal File Ops-Footnote-1999888
-Node: Using Internal File Ops1000028
-Ref: Using Internal File Ops-Footnote-11002375
-Node: Extension Samples1002643
-Node: Extension Sample File Functions1004167
-Node: Extension Sample Fnmatch1011735
-Node: Extension Sample Fork1013202
-Node: Extension Sample Inplace1014415
-Node: Extension Sample Ord1016181
-Node: Extension Sample Readdir1017017
-Ref: table-readdir-file-types1017866
-Node: Extension Sample Revout1018665
-Node: Extension Sample Rev2way1019256
-Node: Extension Sample Read write array1019997
-Node: Extension Sample Readfile1021876
-Node: Extension Sample API Tests1022976
-Node: Extension Sample Time1023501
-Node: gawkextlib1024816
-Node: Language History1027603
-Node: V7/SVR3.11029197
-Node: SVR41031517
-Node: POSIX1032959
-Node: BTL1034345
-Node: POSIX/GNU1035079
-Node: Feature History1040678
-Node: Common Extensions1053790
-Node: Ranges and Locales1055102
-Ref: Ranges and Locales-Footnote-11059719
-Ref: Ranges and Locales-Footnote-21059746
-Ref: Ranges and Locales-Footnote-31059980
-Node: Contributors1060201
-Node: Installation1065639
-Node: Gawk Distribution1066533
-Node: Getting1067017
-Node: Extracting1067843
-Node: Distribution contents1069485
-Node: Unix Installation1075202
-Node: Quick Installation1075819
-Node: Additional Configuration Options1078261
-Node: Configuration Philosophy1079999
-Node: Non-Unix Installation1082350
-Node: PC Installation1082808
-Node: PC Binary Installation1084119
-Node: PC Compiling1085967
-Ref: PC Compiling-Footnote-11088966
-Node: PC Testing1089071
-Node: PC Using1090247
-Node: Cygwin1094405
-Node: MSYS1095214
-Node: VMS Installation1095728
-Node: VMS Compilation1096524
-Ref: VMS Compilation-Footnote-11097739
-Node: VMS Dynamic Extensions1097797
-Node: VMS Installation Details1099170
-Node: VMS Running1101416
-Node: VMS GNV1104250
-Node: VMS Old Gawk1104973
-Node: Bugs1105443
-Node: Other Versions1109447
-Node: Notes1115672
-Node: Compatibility Mode1116472
-Node: Additions1117254
-Node: Accessing The Source1118179
-Node: Adding Code1119615
-Node: New Ports1125793
-Node: Derived Files1130274
-Ref: Derived Files-Footnote-11135355
-Ref: Derived Files-Footnote-21135389
-Ref: Derived Files-Footnote-31135985
-Node: Future Extensions1136099
-Node: Implementation Limitations1136705
-Node: Extension Design1137953
-Node: Old Extension Problems1139107
-Ref: Old Extension Problems-Footnote-11140624
-Node: Extension New Mechanism Goals1140681
-Ref: Extension New Mechanism Goals-Footnote-11144042
-Node: Extension Other Design Decisions1144231
-Node: Extension Future Growth1146337
-Node: Old Extension Mechanism1147173
-Node: Basic Concepts1148913
-Node: Basic High Level1149594
-Ref: figure-general-flow1149866
-Ref: figure-process-flow1150465
-Ref: Basic High Level-Footnote-11153694
-Node: Basic Data Typing1153879
-Node: Glossary1157206
-Node: Copying1182358
-Node: GNU Free Documentation License1219914
-Node: Index1245050
+Node: Running Examples658243
+Node: Clones658971
+Node: Cut Program660195
+Node: Egrep Program670056
+Ref: Egrep Program-Footnote-1677985
+Node: Id Program678095
+Node: Split Program681759
+Ref: Split Program-Footnote-1685290
+Node: Tee Program685418
+Node: Uniq Program688225
+Node: Wc Program695655
+Ref: Wc Program-Footnote-1699923
+Ref: Wc Program-Footnote-2700123
+Node: Miscellaneous Programs700215
+Node: Dupword Program701428
+Node: Alarm Program703459
+Node: Translate Program708273
+Ref: Translate Program-Footnote-1712664
+Ref: Translate Program-Footnote-2712934
+Node: Labels Program713068
+Ref: Labels Program-Footnote-1716439
+Node: Word Sorting716523
+Node: History Sorting720566
+Node: Extract Program722402
+Ref: Extract Program-Footnote-1729977
+Node: Simple Sed730106
+Node: Igawk Program733168
+Ref: Igawk Program-Footnote-1748344
+Ref: Igawk Program-Footnote-2748545
+Node: Anagram Program748683
+Node: Signature Program751751
+Node: Programs Summary752998
+Node: Advanced Features754186
+Node: Nondecimal Data756134
+Node: Array Sorting757711
+Node: Controlling Array Traversal758408
+Node: Array Sorting Functions766688
+Ref: Array Sorting Functions-Footnote-1770595
+Node: Two-way I/O770789
+Ref: Two-way I/O-Footnote-1776305
+Node: TCP/IP Networking776387
+Node: Profiling779231
+Node: Advanced Features Summary786773
+Node: Internationalization788637
+Node: I18N and L10N790117
+Node: Explaining gettext790803
+Ref: Explaining gettext-Footnote-1795943
+Ref: Explaining gettext-Footnote-2796127
+Node: Programmer i18n796292
+Node: Translator i18n800517
+Node: String Extraction801311
+Ref: String Extraction-Footnote-1802272
+Node: Printf Ordering802358
+Ref: Printf Ordering-Footnote-1805140
+Node: I18N Portability805204
+Ref: I18N Portability-Footnote-1807653
+Node: I18N Example807716
+Ref: I18N Example-Footnote-1810438
+Node: Gawk I18N810510
+Node: I18N Summary811148
+Node: Debugger812487
+Node: Debugging813509
+Node: Debugging Concepts813950
+Node: Debugging Terms815806
+Node: Awk Debugging818403
+Node: Sample Debugging Session819295
+Node: Debugger Invocation819815
+Node: Finding The Bug821148
+Node: List of Debugger Commands827630
+Node: Breakpoint Control828962
+Node: Debugger Execution Control832626
+Node: Viewing And Changing Data835986
+Node: Execution Stack839344
+Node: Debugger Info840857
+Node: Miscellaneous Debugger Commands844851
+Node: Readline Support850035
+Node: Limitations850927
+Node: Debugging Summary853201
+Node: Arbitrary Precision Arithmetic854365
+Ref: Arbitrary Precision Arithmetic-Footnote-1856014
+Node: General Arithmetic856162
+Node: Floating Point Issues857882
+Node: String Conversion Precision858763
+Ref: String Conversion Precision-Footnote-1860468
+Node: Unexpected Results860577
+Node: POSIX Floating Point Problems862730
+Ref: POSIX Floating Point Problems-Footnote-1866551
+Node: Integer Programming866589
+Node: Floating-point Programming868400
+Ref: Floating-point Programming-Footnote-1874728
+Ref: Floating-point Programming-Footnote-2874998
+Node: Floating-point Representation875262
+Node: Floating-point Context876427
+Ref: table-ieee-formats877266
+Node: Rounding Mode878650
+Ref: table-rounding-modes879129
+Ref: Rounding Mode-Footnote-1882144
+Node: Gawk and MPFR882323
+Node: Arbitrary Precision Floats883732
+Ref: Arbitrary Precision Floats-Footnote-1886175
+Node: Setting Precision886496
+Ref: table-predefined-precision-strings887180
+Node: Setting Rounding Mode889325
+Ref: table-gawk-rounding-modes889729
+Node: Floating-point Constants890916
+Node: Changing Precision892368
+Ref: Changing Precision-Footnote-1893760
+Node: Exact Arithmetic893934
+Node: Arbitrary Precision Integers897068
+Ref: Arbitrary Precision Integers-Footnote-1900083
+Node: Dynamic Extensions900230
+Node: Extension Intro901688
+Node: Plugin License902953
+Node: Extension Mechanism Outline903638
+Ref: figure-load-extension904062
+Ref: figure-load-new-function905547
+Ref: figure-call-new-function906549
+Node: Extension API Description908533
+Node: Extension API Functions Introduction909983
+Node: General Data Types914849
+Ref: General Data Types-Footnote-1920542
+Node: Requesting Values920841
+Ref: table-value-types-returned921578
+Node: Memory Allocation Functions922536
+Ref: Memory Allocation Functions-Footnote-1925283
+Node: Constructor Functions925379
+Node: Registration Functions927137
+Node: Extension Functions927822
+Node: Exit Callback Functions930124
+Node: Extension Version String931374
+Node: Input Parsers932024
+Node: Output Wrappers941827
+Node: Two-way processors946343
+Node: Printing Messages948547
+Ref: Printing Messages-Footnote-1949624
+Node: Updating `ERRNO'949776
+Node: Accessing Parameters950515
+Node: Symbol Table Access951745
+Node: Symbol table by name952259
+Node: Symbol table by cookie954235
+Ref: Symbol table by cookie-Footnote-1958368
+Node: Cached values958431
+Ref: Cached values-Footnote-1961936
+Node: Array Manipulation962027
+Ref: Array Manipulation-Footnote-1963125
+Node: Array Data Types963164
+Ref: Array Data Types-Footnote-1965867
+Node: Array Functions965959
+Node: Flattening Arrays969833
+Node: Creating Arrays976685
+Node: Extension API Variables981416
+Node: Extension Versioning982052
+Node: Extension API Informational Variables983953
+Node: Extension API Boilerplate985039
+Node: Finding Extensions988843
+Node: Extension Example989403
+Node: Internal File Description990133
+Node: Internal File Ops994224
+Ref: Internal File Ops-Footnote-11005770
+Node: Using Internal File Ops1005910
+Ref: Using Internal File Ops-Footnote-11008257
+Node: Extension Samples1008525
+Node: Extension Sample File Functions1010049
+Node: Extension Sample Fnmatch1017617
+Node: Extension Sample Fork1019084
+Node: Extension Sample Inplace1020297
+Node: Extension Sample Ord1022063
+Node: Extension Sample Readdir1022899
+Ref: table-readdir-file-types1023748
+Node: Extension Sample Revout1024547
+Node: Extension Sample Rev2way1025138
+Node: Extension Sample Read write array1025879
+Node: Extension Sample Readfile1027758
+Node: Extension Sample API Tests1028858
+Node: Extension Sample Time1029383
+Node: gawkextlib1030698
+Node: Language History1033485
+Node: V7/SVR3.11035079
+Node: SVR41037399
+Node: POSIX1038841
+Node: BTL1040227
+Node: POSIX/GNU1040961
+Node: Feature History1046560
+Node: Common Extensions1059672
+Node: Ranges and Locales1060984
+Ref: Ranges and Locales-Footnote-11065601
+Ref: Ranges and Locales-Footnote-21065628
+Ref: Ranges and Locales-Footnote-31065862
+Node: Contributors1066083
+Node: Installation1071521
+Node: Gawk Distribution1072415
+Node: Getting1072899
+Node: Extracting1073725
+Node: Distribution contents1075367
+Node: Unix Installation1081084
+Node: Quick Installation1081701
+Node: Additional Configuration Options1084143
+Node: Configuration Philosophy1085881
+Node: Non-Unix Installation1088232
+Node: PC Installation1088690
+Node: PC Binary Installation1090001
+Node: PC Compiling1091849
+Ref: PC Compiling-Footnote-11094848
+Node: PC Testing1094953
+Node: PC Using1096129
+Node: Cygwin1100287
+Node: MSYS1101096
+Node: VMS Installation1101610
+Node: VMS Compilation1102406
+Ref: VMS Compilation-Footnote-11103621
+Node: VMS Dynamic Extensions1103679
+Node: VMS Installation Details1105052
+Node: VMS Running1107298
+Node: VMS GNV1110132
+Node: VMS Old Gawk1110855
+Node: Bugs1111325
+Node: Other Versions1115329
+Node: Notes1121554
+Node: Compatibility Mode1122354
+Node: Additions1123136
+Node: Accessing The Source1124061
+Node: Adding Code1125497
+Node: New Ports1131675
+Node: Derived Files1136156
+Ref: Derived Files-Footnote-11141237
+Ref: Derived Files-Footnote-21141271
+Ref: Derived Files-Footnote-31141867
+Node: Future Extensions1141981
+Node: Implementation Limitations1142587
+Node: Extension Design1143835
+Node: Old Extension Problems1144989
+Ref: Old Extension Problems-Footnote-11146506
+Node: Extension New Mechanism Goals1146563
+Ref: Extension New Mechanism Goals-Footnote-11149924
+Node: Extension Other Design Decisions1150113
+Node: Extension Future Growth1152219
+Node: Old Extension Mechanism1153055
+Node: Basic Concepts1154795
+Node: Basic High Level1155476
+Ref: figure-general-flow1155748
+Ref: figure-process-flow1156347
+Ref: Basic High Level-Footnote-11159576
+Node: Basic Data Typing1159761
+Node: Glossary1163088
+Node: Copying1188240
+Node: GNU Free Documentation License1225796
+Node: Index1250932

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index c4e17b2b..d6453c8b 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}
@@ -16312,9 +16314,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}]}.
@@ -16330,27 +16332,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
@@ -16359,8 +16360,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
@@ -19956,50 +19957,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.
@@ -22575,9 +22576,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:
@@ -22585,9 +22586,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
@@ -22623,11 +22625,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.
@@ -22650,6 +22652,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
@@ -26149,6 +26152,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
@@ -26189,6 +26228,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.}
@@ -26240,6 +26281,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
@@ -27298,11 +27340,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}
@@ -27336,6 +27423,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
@@ -28098,15 +28186,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
@@ -28123,6 +28250,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
@@ -29401,6 +29529,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 e2d10da9..c91820af 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}
@@ -15646,9 +15648,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}]}.
@@ -15664,27 +15666,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
@@ -15693,8 +15694,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
@@ -19129,50 +19130,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.
@@ -21719,9 +21720,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:
@@ -21729,9 +21730,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
@@ -21767,11 +21769,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.
@@ -21794,6 +21796,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
@@ -25293,6 +25296,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
@@ -25333,6 +25372,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.}
@@ -25384,6 +25425,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
@@ -26442,11 +26484,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}
@@ -26480,6 +26567,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
@@ -27242,15 +27330,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
@@ -27267,6 +27394,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
@@ -28545,6 +28673,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