diff options
Diffstat (limited to 'doc/gawk.info')
-rw-r--r-- | doc/gawk.info | 559 |
1 files changed, 287 insertions, 272 deletions
diff --git a/doc/gawk.info b/doc/gawk.info index 50d23536..12a3b4cd 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -13454,10 +13454,21 @@ algorithms and program tasks in a single place. It simplifies programming, making program development more manageable, and making programs more readable. - One valuable way to learn a new programming language is to _read_ -programs in that language. To that end, this major node and *note -Sample Programs::, provide a good-sized body of code for you to read, -and hopefully, to learn from. + In their seminal 1976 book, `Software Tools'(1), Brian Kernighan and +P.J. Plauger wrote: + + Good Programming is not learned from generalities, but by seeing + how significant programs can be made clean, easy to read, easy to + maintain and modify, human-engineered, efficient and reliable, by + the application of common sense and good programming practices. + Careful study and imitation of good programs leads to better + writing. + + In fact, they felt this idea was so important that they placed this +statement on the cover of their book. Because we believe strongly that +their statement is correct, this major node and *note Sample +Programs::, provide a good-sized body of code for you to read, and we +hope, to learn from. This major node presents a library of useful `awk' functions. Many of the sample programs presented later in this Info file use these @@ -13486,7 +13497,7 @@ for different implementations of `awk' is pretty straightforward. * Finally, some of the programs choose to ignore upper- and lowercase distinctions in their input. They do so by assigning one to - `IGNORECASE'. You can achieve almost the same effect(1) by adding + `IGNORECASE'. You can achieve almost the same effect(2) by adding the following rule to the beginning of the program: # ignore case @@ -13510,7 +13521,10 @@ for different implementations of `awk' is pretty straightforward. ---------- Footnotes ---------- - (1) The effects are not identical. Output of the transformed record + (1) Sadly, over 35 years later, many of the lessons taught by this +book have yet to be learned by a vast number of practicing programmers. + + (2) The effects are not identical. Output of the transformed record will be in all lowercase, while `IGNORECASE' preserves the original contents of the input record. @@ -29701,7 +29715,7 @@ Index * case keyword: Switch Statement. (line 6) * case sensitivity, array indices and: Array Intro. (line 92) * case sensitivity, converting case: String Functions. (line 522) -* case sensitivity, example programs: Library Functions. (line 42) +* case sensitivity, example programs: Library Functions. (line 53) * case sensitivity, gawk: Case-sensitivity. (line 26) * case sensitivity, regexps and <1>: User-modified. (line 82) * case sensitivity, regexps and: Case-sensitivity. (line 6) @@ -30652,7 +30666,7 @@ Index (line 81) * IGNORECASE variable, array subscripts and: Array Intro. (line 92) * IGNORECASE variable, in example programs: Library Functions. - (line 42) + (line 53) * implementation issues, gawk: Notes. (line 6) * implementation issues, gawk, debugging: Compatibility Mode. (line 6) * implementation issues, gawk, limits <1>: Redirection. (line 135) @@ -31102,7 +31116,7 @@ Index (line 81) * portability, data files as single record: Records. (line 180) * portability, deleting array elements: Delete. (line 56) -* portability, example programs: Library Functions. (line 31) +* portability, example programs: Library Functions. (line 42) * portability, fflush() function and: I/O Functions. (line 29) * portability, functions, defining: Definition Syntax. (line 99) * portability, gawk: New Ports. (line 6) @@ -31602,7 +31616,7 @@ Index (line 80) * Texinfo <3>: Extract Program. (line 12) * Texinfo <4>: Dupword Program. (line 17) -* Texinfo <5>: Library Functions. (line 22) +* Texinfo <5>: Library Functions. (line 33) * Texinfo <6>: Sample Data Files. (line 66) * Texinfo: Conventions. (line 6) * Texinfo, chapter beginnings in files: Regexp Operators. (line 22) @@ -32083,267 +32097,268 @@ Node: Return Statement547155 Node: Dynamic Typing550136 Node: Indirect Calls550871 Node: Library Functions560556 -Ref: Library Functions-Footnote-1563555 -Node: Library Names563726 -Ref: Library Names-Footnote-1567197 -Ref: Library Names-Footnote-2567417 -Node: General Functions567503 -Node: Strtonum Function568456 -Node: Assert Function571386 -Node: Round Function574712 -Node: Cliff Random Function576255 -Node: Ordinal Functions577271 -Ref: Ordinal Functions-Footnote-1580341 -Ref: Ordinal Functions-Footnote-2580593 -Node: Join Function580802 -Ref: Join Function-Footnote-1582573 -Node: Getlocaltime Function582773 -Node: Data File Management586488 -Node: Filetrans Function587120 -Node: Rewind Function591259 -Node: File Checking592646 -Node: Empty Files593740 -Node: Ignoring Assigns595970 -Node: Getopt Function597523 -Ref: Getopt Function-Footnote-1608827 -Node: Passwd Functions609030 -Ref: Passwd Functions-Footnote-1618005 -Node: Group Functions618093 -Node: Walking Arrays626177 -Node: Sample Programs627746 -Node: Running Examples628423 -Node: Clones629151 -Node: Cut Program630375 -Node: Egrep Program640220 -Ref: Egrep Program-Footnote-1647993 -Node: Id Program648103 -Node: Split Program651719 -Ref: Split Program-Footnote-1655238 -Node: Tee Program655366 -Node: Uniq Program658169 -Node: Wc Program665598 -Ref: Wc Program-Footnote-1669864 -Ref: Wc Program-Footnote-2670064 -Node: Miscellaneous Programs670156 -Node: Dupword Program671344 -Node: Alarm Program673375 -Node: Translate Program678124 -Ref: Translate Program-Footnote-1682511 -Ref: Translate Program-Footnote-2682739 -Node: Labels Program682873 -Ref: Labels Program-Footnote-1686244 -Node: Word Sorting686328 -Node: History Sorting690212 -Node: Extract Program692051 -Ref: Extract Program-Footnote-1699534 -Node: Simple Sed699662 -Node: Igawk Program702724 -Ref: Igawk Program-Footnote-1717881 -Ref: Igawk Program-Footnote-2718082 -Node: Anagram Program718220 -Node: Signature Program721288 -Node: Internationalization722388 -Node: I18N and L10N723820 -Node: Explaining gettext724506 -Ref: Explaining gettext-Footnote-1729572 -Ref: Explaining gettext-Footnote-2729756 -Node: Programmer i18n729921 -Node: Translator i18n734121 -Node: String Extraction734914 -Ref: String Extraction-Footnote-1735875 -Node: Printf Ordering735961 -Ref: Printf Ordering-Footnote-1738745 -Node: I18N Portability738809 -Ref: I18N Portability-Footnote-1741258 -Node: I18N Example741321 -Ref: I18N Example-Footnote-1743956 -Node: Gawk I18N744028 -Node: Advanced Features744645 -Node: Nondecimal Data746149 -Node: Array Sorting747732 -Node: Controlling Array Traversal748429 -Node: Array Sorting Functions756667 -Ref: Array Sorting Functions-Footnote-1760341 -Ref: Array Sorting Functions-Footnote-2760434 -Node: Two-way I/O760628 -Ref: Two-way I/O-Footnote-1766060 -Node: TCP/IP Networking766130 -Node: Profiling768974 -Node: Debugger776428 -Node: Debugging777396 -Node: Debugging Concepts777829 -Node: Debugging Terms779685 -Node: Awk Debugging782282 -Node: Sample Debugging Session783174 -Node: Debugger Invocation783694 -Node: Finding The Bug785023 -Node: List of Debugger Commands791511 -Node: Breakpoint Control792845 -Node: Debugger Execution Control796509 -Node: Viewing And Changing Data799869 -Node: Execution Stack803225 -Node: Debugger Info804692 -Node: Miscellaneous Debugger Commands808673 -Node: Readline Support814118 -Node: Limitations814949 -Node: Arbitrary Precision Arithmetic817201 -Ref: Arbitrary Precision Arithmetic-Footnote-1818843 -Node: General Arithmetic818991 -Node: Floating Point Issues820711 -Node: String Conversion Precision821592 -Ref: String Conversion Precision-Footnote-1823298 -Node: Unexpected Results823407 -Node: POSIX Floating Point Problems825560 -Ref: POSIX Floating Point Problems-Footnote-1829385 -Node: Integer Programming829423 -Node: Floating-point Programming831176 -Ref: Floating-point Programming-Footnote-1837485 -Node: Floating-point Representation837749 -Node: Floating-point Context838914 -Ref: table-ieee-formats839756 -Node: Rounding Mode841140 -Ref: table-rounding-modes841619 -Ref: Rounding Mode-Footnote-1844623 -Node: Gawk and MPFR844804 -Node: Arbitrary Precision Floats846046 -Ref: Arbitrary Precision Floats-Footnote-1848475 -Node: Setting Precision848786 -Node: Setting Rounding Mode851519 -Ref: table-gawk-rounding-modes851923 -Node: Floating-point Constants853103 -Node: Changing Precision854527 -Ref: Changing Precision-Footnote-1855927 -Node: Exact Arithmetic856101 -Node: Arbitrary Precision Integers859209 -Ref: Arbitrary Precision Integers-Footnote-1862209 -Node: Dynamic Extensions862356 -Node: Extension Intro863733 -Node: Plugin License864941 -Node: Extension Mechanism Outline865626 -Ref: load-extension866043 -Ref: load-new-function867521 -Ref: call-new-function868502 -Node: Extension API Description870496 -Node: Extension API Functions Introduction871835 -Node: General Data Types876613 -Ref: General Data Types-Footnote-1882215 -Node: Requesting Values882514 -Ref: table-value-types-returned883245 -Node: Constructor Functions884199 -Node: Registration Functions887195 -Node: Extension Functions887880 -Node: Exit Callback Functions890054 -Node: Extension Version String891297 -Node: Input Parsers891947 -Node: Output Wrappers901664 -Node: Two-way processors906080 -Node: Printing Messages908210 -Ref: Printing Messages-Footnote-1909287 -Node: Updating `ERRNO'909439 -Node: Accessing Parameters910178 -Node: Symbol Table Access911408 -Node: Symbol table by name911920 -Node: Symbol table by cookie913493 -Ref: Symbol table by cookie-Footnote-1917622 -Node: Cached values917685 -Ref: Cached values-Footnote-1921128 -Node: Array Manipulation921219 -Ref: Array Manipulation-Footnote-1922317 -Node: Array Data Types922356 -Ref: Array Data Types-Footnote-1925059 -Node: Array Functions925151 -Node: Flattening Arrays928917 -Node: Creating Arrays935756 -Node: Extension API Variables940551 -Node: Extension Versioning941187 -Node: Extension API Informational Variables943088 -Node: Extension API Boilerplate944174 -Node: Finding Extensions948005 -Node: Extension Example948552 -Node: Internal File Description949290 -Node: Internal File Ops952978 -Ref: Internal File Ops-Footnote-1964425 -Node: Using Internal File Ops964565 -Ref: Using Internal File Ops-Footnote-1966918 -Node: Extension Samples967184 -Node: Extension Sample File Functions968627 -Node: Extension Sample Fnmatch977100 -Node: Extension Sample Fork978826 -Node: Extension Sample Ord980040 -Node: Extension Sample Readdir980816 -Node: Extension Sample Revout982320 -Node: Extension Sample Rev2way982913 -Node: Extension Sample Read write array983603 -Node: Extension Sample Readfile985486 -Node: Extension Sample API Tests986241 -Node: Extension Sample Time986766 -Node: gawkextlib988073 -Node: Language History990454 -Node: V7/SVR3.1991976 -Node: SVR4994297 -Node: POSIX995739 -Node: BTL996747 -Node: POSIX/GNU997552 -Node: Common Extensions1003087 -Node: Ranges and Locales1004146 -Ref: Ranges and Locales-Footnote-11008764 -Ref: Ranges and Locales-Footnote-21008791 -Ref: Ranges and Locales-Footnote-31009051 -Node: Contributors1009272 -Node: Installation1013568 -Node: Gawk Distribution1014462 -Node: Getting1014946 -Node: Extracting1015772 -Node: Distribution contents1017464 -Node: Unix Installation1022725 -Node: Quick Installation1023342 -Node: Additional Configuration Options1025304 -Node: Configuration Philosophy1026781 -Node: Non-Unix Installation1029123 -Node: PC Installation1029581 -Node: PC Binary Installation1030880 -Node: PC Compiling1032728 -Node: PC Testing1035672 -Node: PC Using1036848 -Node: Cygwin1041033 -Node: MSYS1042033 -Node: VMS Installation1042547 -Node: VMS Compilation1043150 -Ref: VMS Compilation-Footnote-11044157 -Node: VMS Installation Details1044215 -Node: VMS Running1045850 -Node: VMS Old Gawk1047457 -Node: Bugs1047931 -Node: Other Versions1051783 -Node: Notes1057098 -Node: Compatibility Mode1057898 -Node: Additions1058681 -Node: Accessing The Source1059608 -Node: Adding Code1061211 -Node: New Ports1067253 -Node: Derived Files1071388 -Ref: Derived Files-Footnote-11076709 -Ref: Derived Files-Footnote-21076743 -Ref: Derived Files-Footnote-31077343 -Node: Future Extensions1077441 -Node: Implementation Limitations1078022 -Node: Extension Design1079274 -Node: Old Extension Problems1080423 -Ref: Old Extension Problems-Footnote-11081931 -Node: Extension New Mechanism Goals1081988 -Ref: Extension New Mechanism Goals-Footnote-11085347 -Node: Extension Other Design Decisions1085533 -Node: Extension Future Growth1087639 -Node: Old Extension Mechansim1088460 -Node: Basic Concepts1090217 -Node: Basic High Level1090898 -Ref: figure-general-flow1091169 -Ref: figure-process-flow1091768 -Ref: Basic High Level-Footnote-11094997 -Node: Basic Data Typing1095182 -Node: Glossary1098537 -Node: Copying1123848 -Node: GNU Free Documentation License1161405 -Node: Index1186542 +Ref: Library Functions-Footnote-1564069 +Ref: Library Functions-Footnote-2564212 +Node: Library Names564383 +Ref: Library Names-Footnote-1567854 +Ref: Library Names-Footnote-2568074 +Node: General Functions568160 +Node: Strtonum Function569113 +Node: Assert Function572043 +Node: Round Function575369 +Node: Cliff Random Function576912 +Node: Ordinal Functions577928 +Ref: Ordinal Functions-Footnote-1580998 +Ref: Ordinal Functions-Footnote-2581250 +Node: Join Function581459 +Ref: Join Function-Footnote-1583230 +Node: Getlocaltime Function583430 +Node: Data File Management587145 +Node: Filetrans Function587777 +Node: Rewind Function591916 +Node: File Checking593303 +Node: Empty Files594397 +Node: Ignoring Assigns596627 +Node: Getopt Function598180 +Ref: Getopt Function-Footnote-1609484 +Node: Passwd Functions609687 +Ref: Passwd Functions-Footnote-1618662 +Node: Group Functions618750 +Node: Walking Arrays626834 +Node: Sample Programs628403 +Node: Running Examples629080 +Node: Clones629808 +Node: Cut Program631032 +Node: Egrep Program640877 +Ref: Egrep Program-Footnote-1648650 +Node: Id Program648760 +Node: Split Program652376 +Ref: Split Program-Footnote-1655895 +Node: Tee Program656023 +Node: Uniq Program658826 +Node: Wc Program666255 +Ref: Wc Program-Footnote-1670521 +Ref: Wc Program-Footnote-2670721 +Node: Miscellaneous Programs670813 +Node: Dupword Program672001 +Node: Alarm Program674032 +Node: Translate Program678781 +Ref: Translate Program-Footnote-1683168 +Ref: Translate Program-Footnote-2683396 +Node: Labels Program683530 +Ref: Labels Program-Footnote-1686901 +Node: Word Sorting686985 +Node: History Sorting690869 +Node: Extract Program692708 +Ref: Extract Program-Footnote-1700191 +Node: Simple Sed700319 +Node: Igawk Program703381 +Ref: Igawk Program-Footnote-1718538 +Ref: Igawk Program-Footnote-2718739 +Node: Anagram Program718877 +Node: Signature Program721945 +Node: Internationalization723045 +Node: I18N and L10N724477 +Node: Explaining gettext725163 +Ref: Explaining gettext-Footnote-1730229 +Ref: Explaining gettext-Footnote-2730413 +Node: Programmer i18n730578 +Node: Translator i18n734778 +Node: String Extraction735571 +Ref: String Extraction-Footnote-1736532 +Node: Printf Ordering736618 +Ref: Printf Ordering-Footnote-1739402 +Node: I18N Portability739466 +Ref: I18N Portability-Footnote-1741915 +Node: I18N Example741978 +Ref: I18N Example-Footnote-1744613 +Node: Gawk I18N744685 +Node: Advanced Features745302 +Node: Nondecimal Data746806 +Node: Array Sorting748389 +Node: Controlling Array Traversal749086 +Node: Array Sorting Functions757324 +Ref: Array Sorting Functions-Footnote-1760998 +Ref: Array Sorting Functions-Footnote-2761091 +Node: Two-way I/O761285 +Ref: Two-way I/O-Footnote-1766717 +Node: TCP/IP Networking766787 +Node: Profiling769631 +Node: Debugger777085 +Node: Debugging778053 +Node: Debugging Concepts778486 +Node: Debugging Terms780342 +Node: Awk Debugging782939 +Node: Sample Debugging Session783831 +Node: Debugger Invocation784351 +Node: Finding The Bug785680 +Node: List of Debugger Commands792168 +Node: Breakpoint Control793502 +Node: Debugger Execution Control797166 +Node: Viewing And Changing Data800526 +Node: Execution Stack803882 +Node: Debugger Info805349 +Node: Miscellaneous Debugger Commands809330 +Node: Readline Support814775 +Node: Limitations815606 +Node: Arbitrary Precision Arithmetic817858 +Ref: Arbitrary Precision Arithmetic-Footnote-1819500 +Node: General Arithmetic819648 +Node: Floating Point Issues821368 +Node: String Conversion Precision822249 +Ref: String Conversion Precision-Footnote-1823955 +Node: Unexpected Results824064 +Node: POSIX Floating Point Problems826217 +Ref: POSIX Floating Point Problems-Footnote-1830042 +Node: Integer Programming830080 +Node: Floating-point Programming831833 +Ref: Floating-point Programming-Footnote-1838142 +Node: Floating-point Representation838406 +Node: Floating-point Context839571 +Ref: table-ieee-formats840413 +Node: Rounding Mode841797 +Ref: table-rounding-modes842276 +Ref: Rounding Mode-Footnote-1845280 +Node: Gawk and MPFR845461 +Node: Arbitrary Precision Floats846703 +Ref: Arbitrary Precision Floats-Footnote-1849132 +Node: Setting Precision849443 +Node: Setting Rounding Mode852176 +Ref: table-gawk-rounding-modes852580 +Node: Floating-point Constants853760 +Node: Changing Precision855184 +Ref: Changing Precision-Footnote-1856584 +Node: Exact Arithmetic856758 +Node: Arbitrary Precision Integers859866 +Ref: Arbitrary Precision Integers-Footnote-1862866 +Node: Dynamic Extensions863013 +Node: Extension Intro864390 +Node: Plugin License865598 +Node: Extension Mechanism Outline866283 +Ref: load-extension866700 +Ref: load-new-function868178 +Ref: call-new-function869159 +Node: Extension API Description871153 +Node: Extension API Functions Introduction872492 +Node: General Data Types877270 +Ref: General Data Types-Footnote-1882872 +Node: Requesting Values883171 +Ref: table-value-types-returned883902 +Node: Constructor Functions884856 +Node: Registration Functions887852 +Node: Extension Functions888537 +Node: Exit Callback Functions890711 +Node: Extension Version String891954 +Node: Input Parsers892604 +Node: Output Wrappers902321 +Node: Two-way processors906737 +Node: Printing Messages908867 +Ref: Printing Messages-Footnote-1909944 +Node: Updating `ERRNO'910096 +Node: Accessing Parameters910835 +Node: Symbol Table Access912065 +Node: Symbol table by name912577 +Node: Symbol table by cookie914150 +Ref: Symbol table by cookie-Footnote-1918279 +Node: Cached values918342 +Ref: Cached values-Footnote-1921785 +Node: Array Manipulation921876 +Ref: Array Manipulation-Footnote-1922974 +Node: Array Data Types923013 +Ref: Array Data Types-Footnote-1925716 +Node: Array Functions925808 +Node: Flattening Arrays929574 +Node: Creating Arrays936413 +Node: Extension API Variables941208 +Node: Extension Versioning941844 +Node: Extension API Informational Variables943745 +Node: Extension API Boilerplate944831 +Node: Finding Extensions948662 +Node: Extension Example949209 +Node: Internal File Description949947 +Node: Internal File Ops953635 +Ref: Internal File Ops-Footnote-1965082 +Node: Using Internal File Ops965222 +Ref: Using Internal File Ops-Footnote-1967575 +Node: Extension Samples967841 +Node: Extension Sample File Functions969284 +Node: Extension Sample Fnmatch977757 +Node: Extension Sample Fork979483 +Node: Extension Sample Ord980697 +Node: Extension Sample Readdir981473 +Node: Extension Sample Revout982977 +Node: Extension Sample Rev2way983570 +Node: Extension Sample Read write array984260 +Node: Extension Sample Readfile986143 +Node: Extension Sample API Tests986898 +Node: Extension Sample Time987423 +Node: gawkextlib988730 +Node: Language History991111 +Node: V7/SVR3.1992633 +Node: SVR4994954 +Node: POSIX996396 +Node: BTL997404 +Node: POSIX/GNU998209 +Node: Common Extensions1003744 +Node: Ranges and Locales1004803 +Ref: Ranges and Locales-Footnote-11009421 +Ref: Ranges and Locales-Footnote-21009448 +Ref: Ranges and Locales-Footnote-31009708 +Node: Contributors1009929 +Node: Installation1014225 +Node: Gawk Distribution1015119 +Node: Getting1015603 +Node: Extracting1016429 +Node: Distribution contents1018121 +Node: Unix Installation1023382 +Node: Quick Installation1023999 +Node: Additional Configuration Options1025961 +Node: Configuration Philosophy1027438 +Node: Non-Unix Installation1029780 +Node: PC Installation1030238 +Node: PC Binary Installation1031537 +Node: PC Compiling1033385 +Node: PC Testing1036329 +Node: PC Using1037505 +Node: Cygwin1041690 +Node: MSYS1042690 +Node: VMS Installation1043204 +Node: VMS Compilation1043807 +Ref: VMS Compilation-Footnote-11044814 +Node: VMS Installation Details1044872 +Node: VMS Running1046507 +Node: VMS Old Gawk1048114 +Node: Bugs1048588 +Node: Other Versions1052440 +Node: Notes1057755 +Node: Compatibility Mode1058555 +Node: Additions1059338 +Node: Accessing The Source1060265 +Node: Adding Code1061868 +Node: New Ports1067910 +Node: Derived Files1072045 +Ref: Derived Files-Footnote-11077366 +Ref: Derived Files-Footnote-21077400 +Ref: Derived Files-Footnote-31078000 +Node: Future Extensions1078098 +Node: Implementation Limitations1078679 +Node: Extension Design1079931 +Node: Old Extension Problems1081080 +Ref: Old Extension Problems-Footnote-11082588 +Node: Extension New Mechanism Goals1082645 +Ref: Extension New Mechanism Goals-Footnote-11086004 +Node: Extension Other Design Decisions1086190 +Node: Extension Future Growth1088296 +Node: Old Extension Mechansim1089117 +Node: Basic Concepts1090874 +Node: Basic High Level1091555 +Ref: figure-general-flow1091826 +Ref: figure-process-flow1092425 +Ref: Basic High Level-Footnote-11095654 +Node: Basic Data Typing1095839 +Node: Glossary1099194 +Node: Copying1124505 +Node: GNU Free Documentation License1162062 +Node: Index1187199 End Tag Table |