diff options
-rw-r--r-- | doc/ChangeLog | 4 | ||||
-rw-r--r-- | doc/gawk.info | 1299 | ||||
-rw-r--r-- | doc/gawk.texi | 59 | ||||
-rw-r--r-- | doc/gawktexi.in | 59 |
4 files changed, 800 insertions, 621 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog index 696dafaa..4659f15c 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,9 @@ 2021-04-04 Arnold D. Robbins <arnold@skeeve.com> + * gawktexi.in: Start documenting bool features. + +2021-04-04 Arnold D. Robbins <arnold@skeeve.com> + * gawktexi.in: Update menues. 2021-03-31 Arnold D. Robbins <arnold@skeeve.com> diff --git a/doc/gawk.info b/doc/gawk.info index 057f18d9..9f3abe03 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -381,6 +381,8 @@ in (a) below. A copy of the license is included in the section entitled * Arrays Summary:: Summary of arrays. * Built-in:: Summarizes the built-in functions. * Calling Built-in:: How to call built-in functions. +* Boolean Functions:: A function that returns Boolean + values. * Numeric Functions:: Functions that work with numbers, including 'int()', 'sin()' and 'rand()'. @@ -488,6 +490,7 @@ in (a) below. A copy of the license is included in the section entitled * Programs Summary:: Summary of programs. * Programs Exercises:: Exercises. * Nondecimal Data:: Allowing nondecimal input data. +* Boolean Typed Values:: Values with 'bool' type. * Array Sorting:: Facilities for controlling array traversal and sorting arrays. * Controlling Array Traversal:: How to use PROCINFO["sorted_in"]. @@ -12782,6 +12785,7 @@ your convenience. * Menu: * Calling Built-in:: How to call built-in functions. +* Boolean Functions:: A function that returns Boolean values. * Numeric Functions:: Functions that work with numbers, including 'int()', 'sin()' and 'rand()'. * String Functions:: Functions for string manipulation, such as @@ -12794,7 +12798,7 @@ your convenience. * I18N Functions:: Functions for string translation. -File: gawk.info, Node: Calling Built-in, Next: Numeric Functions, Up: Built-in +File: gawk.info, Node: Calling Built-in, Next: Boolean Functions, Up: Built-in 9.1.1 Calling Built-in Functions -------------------------------- @@ -12838,9 +12842,22 @@ six, and then 12, and 'atan2()' is called with the two arguments six and 10, then 11, and 'atan2()' is called with the two arguments 11 and 10. -File: gawk.info, Node: Numeric Functions, Next: String Functions, Prev: Calling Built-in, Up: Built-in +File: gawk.info, Node: Boolean Functions, Next: Numeric Functions, Prev: Calling Built-in, Up: Built-in -9.1.2 Numeric Functions +9.1.2 Generating Boolean Values +------------------------------- + +This functions is specific to 'gawk'. It is not available in +compatibility mode (*note Options::): + +'bool(EXPRESSION)' + + blah blah + + +File: gawk.info, Node: Numeric Functions, Next: String Functions, Prev: Boolean Functions, Up: Built-in + +9.1.3 Numeric Functions ----------------------- The following list describes all of the built-in functions that work @@ -12964,7 +12981,7 @@ the same sequence of random numbers over and over again. File: gawk.info, Node: String Functions, Next: I/O Functions, Prev: Numeric Functions, Up: Built-in -9.1.3 String-Manipulation Functions +9.1.4 String-Manipulation Functions ----------------------------------- The functions in this minor node look at or change the text of one or @@ -13532,7 +13549,7 @@ number zero. File: gawk.info, Node: Gory Details, Up: String Functions -9.1.3.1 More about '\' and '&' with 'sub()', 'gsub()', and 'gensub()' +9.1.4.1 More about '\' and '&' with 'sub()', 'gsub()', and 'gensub()' ..................................................................... CAUTION: This subsubsection has been reported to cause headaches. @@ -13678,7 +13695,7 @@ POSIX rules. File: gawk.info, Node: I/O Functions, Next: Time Functions, Prev: String Functions, Up: Built-in -9.1.4 Input/Output Functions +9.1.5 Input/Output Functions ---------------------------- The following functions relate to input/output (I/O). Optional @@ -13895,7 +13912,7 @@ the way this was done was probably a mistake. File: gawk.info, Node: Time Functions, Next: Bitwise Functions, Prev: I/O Functions, Up: Built-in -9.1.5 Time Functions +9.1.6 Time Functions -------------------- 'awk' programs are commonly used to process log files containing @@ -14212,7 +14229,7 @@ does not appear in the returned string or appears literally. File: gawk.info, Node: Bitwise Functions, Next: Type Functions, Prev: Time Functions, Up: Built-in -9.1.6 Bit-Manipulation Functions +9.1.7 Bit-Manipulation Functions -------------------------------- I can explain it for you, but I can't understand it for you. @@ -14394,7 +14411,7 @@ that range are reduced to fit within the range. File: gawk.info, Node: Type Functions, Next: I18N Functions, Prev: Bitwise Functions, Up: Built-in -9.1.7 Getting Type Information +9.1.8 Getting Type Information ------------------------------ 'gawk' provides two functions that let you distinguish the type of a @@ -14479,7 +14496,7 @@ arguments from untyped to unassigned. File: gawk.info, Node: I18N Functions, Prev: Type Functions, Up: Built-in -9.1.8 String-Translation Functions +9.1.9 String-Translation Functions ---------------------------------- 'gawk' provides facilities for internationalizing 'awk' programs. These @@ -15158,7 +15175,7 @@ File: gawk.info, Node: Indirect Calls, Next: Functions Summary, Prev: User-de 9.3 Indirect Function Calls =========================== -This section describes an advanced, 'gawk'-specific extension. +This minor node describes an advanced, 'gawk'-specific extension. Often, you may wish to defer the choice of function to call until runtime. For example, you may have different kinds of records, each of @@ -20873,6 +20890,7 @@ their own: * Menu: * Nondecimal Data:: Allowing nondecimal input data. +* Boolean Typed Values:: Values with 'bool' type. * Array Sorting:: Facilities for controlling array traversal and sorting arrays. * Two-way I/O:: Two-way communications with another process. @@ -20882,7 +20900,7 @@ their own: * Advanced Features Summary:: Summary of advanced features. -File: gawk.info, Node: Nondecimal Data, Next: Array Sorting, Up: Advanced Features +File: gawk.info, Node: Nondecimal Data, Next: Boolean Typed Values, Up: Advanced Features 12.1 Allowing Nondecimal Input Data =================================== @@ -20925,9 +20943,48 @@ request it. This option may disappear in a future version of 'gawk'. -File: gawk.info, Node: Array Sorting, Next: Two-way I/O, Prev: Nondecimal Data, Up: Advanced Features +File: gawk.info, Node: Boolean Typed Values, Next: Array Sorting, Prev: Nondecimal Data, Up: Advanced Features + +12.2 Boolean Typed Values +========================= + +This minor node describes an advanced, 'gawk'-specific extension. + + Scalar values in 'awk' are either numbers or strings. 'gawk' also +supports values of type 'regexp' (FIXME pxref). + + As seen in FIXME @ref{} here, Boolean values in 'awk' don't have a +separate type: a value counts as "true" if it is nonzero or non-null, +and as "false" otherwise. + + When interchanging data with languages that do have a real Boolean +type, using a standard format such as JSON or XML, the lack of a true +Boolean type in 'awk' is problematic. (FIXME: xref to gawkextlib json +extension) + + It's easy to import Boolean data into 'awk', but then the fact that +it was originally Boolean is lost. Exporting data is even harder; +there's no way to indicate that a value is really Boolean. + + To solve this problem, 'gawk' provides a function named 'bool()'. It +takes one argument, which is any 'awk' expression, and it returns a +value of Boolean type. + + The returned values are different than normal 'awk' values. When +treated as numbers, they are either one or zero, depending upon the +truth value of the expression passed in the call. When treated as +strings, they are either '"TRUE"' or '"FALSE"', again depending upon the +truth value of the expression passed in the call. The value for "false" +is thus unusual; it is zero numerically, but not empty when treated as a +string. + + The 'typeof()' function (FIXME pxref here) returns '"bool"' for these +values. + + +File: gawk.info, Node: Array Sorting, Next: Two-way I/O, Prev: Boolean Typed Values, Up: Advanced Features -12.2 Controlling Array Traversal and Array Sorting +12.3 Controlling Array Traversal and Array Sorting ================================================== 'gawk' lets you control the order in which a 'for (INDX in ARRAY)' loop @@ -20946,7 +21003,7 @@ to order the elements during sorting. File: gawk.info, Node: Controlling Array Traversal, Next: Array Sorting Functions, Up: Array Sorting -12.2.1 Controlling Array Traversal +12.3.1 Controlling Array Traversal ---------------------------------- By default, the order in which a 'for (INDX in ARRAY)' loop scans an @@ -21185,7 +21242,7 @@ character, which cannot be part of an identifier. File: gawk.info, Node: Array Sorting Functions, Prev: Controlling Array Traversal, Up: Array Sorting -12.2.2 Sorting Array Values and Indices with 'gawk' +12.3.2 Sorting Array Values and Indices with 'gawk' --------------------------------------------------- In most 'awk' implementations, sorting an array requires writing a @@ -21325,7 +21382,7 @@ POSIX-compatibility mode, and because 'asort()' and 'asorti()' are File: gawk.info, Node: Two-way I/O, Next: TCP/IP Networking, Prev: Array Sorting, Up: Advanced Features -12.3 Two-Way Communications with Another Process +12.4 Two-Way Communications with Another Process ================================================ It is often useful to be able to send data to a separate program for @@ -21520,7 +21577,7 @@ in Bash. File: gawk.info, Node: TCP/IP Networking, Next: Profiling, Prev: Two-way I/O, Up: Advanced Features -12.4 Using 'gawk' for Network Programming +12.5 Using 'gawk' for Network Programming ========================================= 'EMRED': @@ -21600,7 +21657,7 @@ complete introduction and discussion, as well as extensive examples. File: gawk.info, Node: Profiling, Next: Extension Philosophy, Prev: TCP/IP Networking, Up: Advanced Features -12.5 Profiling Your 'awk' Programs +12.6 Profiling Your 'awk' Programs ================================== You may produce execution traces of your 'awk' programs. This is done @@ -21862,7 +21919,7 @@ source code, it will appear that way in the output. File: gawk.info, Node: Extension Philosophy, Next: Advanced Features Summary, Prev: Profiling, Up: Advanced Features -12.6 Builtin Features versus Extensions +12.7 Builtin Features versus Extensions ======================================= As this and subsequent major nodes show, 'gawk' has a large number of @@ -21898,7 +21955,7 @@ or need. File: gawk.info, Node: Advanced Features Summary, Prev: Extension Philosophy, Up: Advanced Features -12.7 Summary +12.8 Summary ============ * The '--non-decimal-data' option causes 'gawk' to treat octal- and @@ -35317,8 +35374,10 @@ Index * bitwise, XOR: Bitwise Functions. (line 57) * body, in actions: Statements. (line 10) * body, in loops: While Statement. (line 14) +* bool: Boolean Functions. (line 10) * Boolean expressions: Boolean Ops. (line 6) * Boolean expressions, as patterns: Expression Patterns. (line 39) +* boolean function: Boolean Functions. (line 6) * Bourne shell, quoting rules for: Quoting. (line 18) * braces ({}), regexp operator: Regexp Operator Details. (line 118) @@ -38125,604 +38184,606 @@ Index Tag Table: Node: Top1200 -Node: Foreword344859 -Node: Foreword449301 -Node: Preface50833 -Ref: Preface-Footnote-153692 -Ref: Preface-Footnote-253801 -Ref: Preface-Footnote-354035 -Node: History54177 -Node: Names56529 -Ref: Names-Footnote-157633 -Node: This Manual57780 -Ref: This Manual-Footnote-164419 -Node: Conventions64519 -Node: Manual History66888 -Ref: Manual History-Footnote-169885 -Ref: Manual History-Footnote-269926 -Node: How To Contribute70000 -Node: Acknowledgments70926 -Node: Getting Started75863 -Node: Running gawk78302 -Node: One-shot79492 -Node: Read Terminal80755 -Node: Long82748 -Node: Executable Scripts84261 -Ref: Executable Scripts-Footnote-186894 -Node: Comments86997 -Node: Quoting89481 -Node: DOS Quoting95007 -Node: Sample Data Files97063 -Node: Very Simple99658 -Node: Two Rules105760 -Node: More Complex107645 -Node: Statements/Lines109977 -Ref: Statements/Lines-Footnote-1114461 -Node: Other Features114726 -Node: When115662 -Ref: When-Footnote-1117416 -Node: Intro Summary117481 -Node: Invoking Gawk118365 -Node: Command Line119879 -Node: Options120677 -Ref: Options-Footnote-1138591 -Ref: Options-Footnote-2138822 -Node: Other Arguments138847 -Node: Naming Standard Input142858 -Node: Environment Variables144068 -Node: AWKPATH Variable144626 -Ref: AWKPATH Variable-Footnote-1148038 -Ref: AWKPATH Variable-Footnote-2148072 -Node: AWKLIBPATH Variable148443 -Ref: AWKLIBPATH Variable-Footnote-1150140 -Node: Other Environment Variables150515 -Node: Exit Status154467 -Node: Include Files155144 -Node: Loading Shared Libraries158834 -Node: Obsolete160262 -Node: Undocumented160954 -Node: Invoking Summary161251 -Node: Regexp164092 -Node: Regexp Usage165546 -Node: Escape Sequences167583 -Node: Regexp Operators173824 -Node: Regexp Operator Details174309 -Ref: Regexp Operator Details-Footnote-1181673 -Node: Interval Expressions181820 -Ref: Interval Expressions-Footnote-1183241 -Node: Bracket Expressions183339 -Ref: table-char-classes185815 -Node: Leftmost Longest189141 -Node: Computed Regexps190444 -Node: GNU Regexp Operators193871 -Node: Case-sensitivity197608 -Ref: Case-sensitivity-Footnote-1200474 -Ref: Case-sensitivity-Footnote-2200709 -Node: Regexp Summary200817 -Node: Reading Files202283 -Node: Records204552 -Node: awk split records205627 -Node: gawk split records210327 -Ref: gawk split records-Footnote-1215401 -Node: Fields215438 -Node: Nonconstant Fields218179 -Ref: Nonconstant Fields-Footnote-1220415 -Node: Changing Fields220619 -Node: Field Separators226650 -Node: Default Field Splitting229348 -Node: Regexp Field Splitting230466 -Node: Single Character Fields234143 -Node: Command Line Field Separator235203 -Node: Full Line Fields238421 -Ref: Full Line Fields-Footnote-1239943 -Ref: Full Line Fields-Footnote-2239989 -Node: Field Splitting Summary240090 -Node: Constant Size242164 -Node: Fixed width data242896 -Node: Skipping intervening246363 -Node: Allowing trailing data247161 -Node: Fields with fixed data248198 -Node: Splitting By Content249716 -Ref: Splitting By Content-Footnote-1253499 -Node: More CSV253662 -Node: Testing field creation255254 -Node: Multiple Line256879 -Node: Getline263156 -Node: Plain Getline265625 -Node: Getline/Variable268198 -Node: Getline/File269349 -Node: Getline/Variable/File270737 -Ref: Getline/Variable/File-Footnote-1272342 -Node: Getline/Pipe272430 -Node: Getline/Variable/Pipe275134 -Node: Getline/Coprocess276269 -Node: Getline/Variable/Coprocess277536 -Node: Getline Notes278278 -Node: Getline Summary281075 -Ref: table-getline-variants281499 -Node: Read Timeout282247 -Ref: Read Timeout-Footnote-1286153 -Node: Retrying Input286211 -Node: Command-line directories287410 -Node: Input Summary288316 -Node: Input Exercises291488 -Node: Printing291922 -Node: Print293756 -Node: Print Examples295213 -Node: Output Separators297993 -Node: OFMT300010 -Node: Printf301366 -Node: Basic Printf302151 -Node: Control Letters303725 -Node: Format Modifiers308887 -Node: Printf Examples314902 -Node: Redirection317388 -Node: Special FD324229 -Ref: Special FD-Footnote-1327397 -Node: Special Files327471 -Node: Other Inherited Files328088 -Node: Special Network329089 -Node: Special Caveats329949 -Node: Close Files And Pipes330898 -Ref: table-close-pipe-return-values337805 -Ref: Close Files And Pipes-Footnote-1338618 -Ref: Close Files And Pipes-Footnote-2338766 -Node: Nonfatal338918 -Node: Output Summary341256 -Node: Output Exercises342478 -Node: Expressions343157 -Node: Values344345 -Node: Constants345023 -Node: Scalar Constants345714 -Ref: Scalar Constants-Footnote-1348224 -Node: Nondecimal-numbers348474 -Node: Regexp Constants351475 -Node: Using Constant Regexps352001 -Node: Standard Regexp Constants352623 -Node: Strong Regexp Constants355811 -Node: Variables358823 -Node: Using Variables359480 -Node: Assignment Options361390 -Node: Conversion363861 -Node: Strings And Numbers364385 -Ref: Strings And Numbers-Footnote-1367448 -Node: Locale influences conversions367557 -Ref: table-locale-affects370315 -Node: All Operators370933 -Node: Arithmetic Ops371562 -Node: Concatenation374278 -Ref: Concatenation-Footnote-1377125 -Node: Assignment Ops377232 -Ref: table-assign-ops382223 -Node: Increment Ops383536 -Node: Truth Values and Conditions386996 -Node: Truth Values388070 -Node: Typing and Comparison389118 -Node: Variable Typing389938 -Ref: Variable Typing-Footnote-1396401 -Ref: Variable Typing-Footnote-2396473 -Node: Comparison Operators396550 -Ref: table-relational-ops396969 -Node: POSIX String Comparison400464 -Ref: POSIX String Comparison-Footnote-1402159 -Ref: POSIX String Comparison-Footnote-2402298 -Node: Boolean Ops402382 -Ref: Boolean Ops-Footnote-1406864 -Node: Conditional Exp406956 -Node: Function Calls408692 -Node: Precedence412569 -Node: Locales416228 -Node: Expressions Summary417860 -Node: Patterns and Actions420433 -Node: Pattern Overview421553 -Node: Regexp Patterns423230 -Node: Expression Patterns423772 -Node: Ranges427553 -Node: BEGIN/END430661 -Node: Using BEGIN/END431422 -Ref: Using BEGIN/END-Footnote-1434176 -Node: I/O And BEGIN/END434282 -Node: BEGINFILE/ENDFILE436595 -Node: Empty439826 -Node: Using Shell Variables440143 -Node: Action Overview442417 -Node: Statements444742 -Node: If Statement446590 -Node: While Statement448085 -Node: Do Statement450113 -Node: For Statement451261 -Node: Switch Statement454432 -Node: Break Statement456873 -Node: Continue Statement458965 -Node: Next Statement460792 -Node: Nextfile Statement463175 -Node: Exit Statement465864 -Node: Built-in Variables468267 -Node: User-modified469400 -Node: Auto-set477167 -Ref: Auto-set-Footnote-1493974 -Ref: Auto-set-Footnote-2494180 -Node: ARGC and ARGV494236 -Node: Pattern Action Summary498449 -Node: Arrays500879 -Node: Array Basics502208 -Node: Array Intro503052 -Ref: figure-array-elements505027 -Ref: Array Intro-Footnote-1507731 -Node: Reference to Elements507859 -Node: Assigning Elements510323 -Node: Array Example510814 -Node: Scanning an Array512573 -Node: Controlling Scanning515595 -Ref: Controlling Scanning-Footnote-1522051 -Node: Numeric Array Subscripts522367 -Node: Uninitialized Subscripts524551 -Node: Delete526170 -Ref: Delete-Footnote-1528922 -Node: Multidimensional528979 -Node: Multiscanning532074 -Node: Arrays of Arrays533665 -Node: Arrays Summary538433 -Node: Functions540526 -Node: Built-in541564 -Node: Calling Built-in542645 -Node: Numeric Functions544641 -Ref: Numeric Functions-Footnote-1548667 -Ref: Numeric Functions-Footnote-2549315 -Ref: Numeric Functions-Footnote-3549363 -Node: String Functions549635 -Ref: String Functions-Footnote-1573776 -Ref: String Functions-Footnote-2573904 -Ref: String Functions-Footnote-3574152 -Node: Gory Details574239 -Ref: table-sub-escapes576030 -Ref: table-sub-proposed577549 -Ref: table-posix-sub578912 -Ref: table-gensub-escapes580453 -Ref: Gory Details-Footnote-1581276 -Node: I/O Functions581430 -Ref: table-system-return-values587884 -Ref: I/O Functions-Footnote-1589964 -Ref: I/O Functions-Footnote-2590112 -Node: Time Functions590232 -Ref: Time Functions-Footnote-1600903 -Ref: Time Functions-Footnote-2600971 -Ref: Time Functions-Footnote-3601129 -Ref: Time Functions-Footnote-4601240 -Ref: Time Functions-Footnote-5601352 -Ref: Time Functions-Footnote-6601579 -Node: Bitwise Functions601845 -Ref: table-bitwise-ops602439 -Ref: Bitwise Functions-Footnote-1608502 -Ref: Bitwise Functions-Footnote-2608675 -Node: Type Functions608866 -Node: I18N Functions611729 -Node: User-defined613380 -Node: Definition Syntax614192 -Ref: Definition Syntax-Footnote-1619886 -Node: Function Example619957 -Ref: Function Example-Footnote-1622879 -Node: Function Calling622901 -Node: Calling A Function623489 -Node: Variable Scope624447 -Node: Pass By Value/Reference627441 -Node: Function Caveats630085 -Ref: Function Caveats-Footnote-1632132 -Node: Return Statement632252 -Node: Dynamic Typing635231 -Node: Indirect Calls636161 -Ref: Indirect Calls-Footnote-1646413 -Node: Functions Summary646541 -Node: Library Functions649246 -Ref: Library Functions-Footnote-1652853 -Ref: Library Functions-Footnote-2652996 -Node: Library Names653167 -Ref: Library Names-Footnote-1656834 -Ref: Library Names-Footnote-2657057 -Node: General Functions657143 -Node: Strtonum Function658246 -Node: Assert Function661268 -Node: Round Function664594 -Node: Cliff Random Function666134 -Node: Ordinal Functions667150 -Ref: Ordinal Functions-Footnote-1670213 -Ref: Ordinal Functions-Footnote-2670465 -Node: Join Function670675 -Ref: Join Function-Footnote-1672445 -Node: Getlocaltime Function672645 -Node: Readfile Function676387 -Node: Shell Quoting678364 -Node: Data File Management679765 -Node: Filetrans Function680397 -Node: Rewind Function684493 -Node: File Checking686402 -Ref: File Checking-Footnote-1687736 -Node: Empty Files687937 -Node: Ignoring Assigns689916 -Node: Getopt Function691466 -Ref: Getopt Function-Footnote-1706677 -Node: Passwd Functions706877 -Ref: Passwd Functions-Footnote-1715716 -Node: Group Functions715804 -Ref: Group Functions-Footnote-1723702 -Node: Walking Arrays723909 -Node: Library Functions Summary726917 -Node: Library Exercises728323 -Node: Sample Programs728788 -Node: Running Examples729558 -Node: Clones730286 -Node: Cut Program731510 -Node: Egrep Program741650 -Node: Id Program750651 -Node: Split Program760598 -Ref: Split Program-Footnote-1770488 -Node: Tee Program770661 -Node: Uniq Program773451 -Node: Wc Program781039 -Node: Bytes vs. Characters781426 -Node: Using extensions782974 -Node: wc program783728 -Node: Miscellaneous Programs788593 -Node: Dupword Program789806 -Node: Alarm Program791836 -Node: Translate Program796691 -Ref: Translate Program-Footnote-1801256 -Node: Labels Program801526 -Ref: Labels Program-Footnote-1804877 -Node: Word Sorting804961 -Node: History Sorting809033 -Node: Extract Program811258 -Node: Simple Sed819312 -Node: Igawk Program822386 -Ref: Igawk Program-Footnote-1836717 -Ref: Igawk Program-Footnote-2836919 -Ref: Igawk Program-Footnote-3837041 -Node: Anagram Program837156 -Node: Signature Program840218 -Node: Programs Summary841465 -Node: Programs Exercises842679 -Ref: Programs Exercises-Footnote-1846809 -Node: Advanced Features846895 -Node: Nondecimal Data848962 -Node: Array Sorting850553 -Node: Controlling Array Traversal851253 -Ref: Controlling Array Traversal-Footnote-1859621 -Node: Array Sorting Functions859739 -Ref: Array Sorting Functions-Footnote-1864830 -Node: Two-way I/O865026 -Ref: Two-way I/O-Footnote-1872747 -Ref: Two-way I/O-Footnote-2872934 -Node: TCP/IP Networking873016 -Node: Profiling876134 -Node: Extension Philosophy885443 -Node: Advanced Features Summary886922 -Node: Internationalization888937 -Node: I18N and L10N890417 -Node: Explaining gettext891104 -Ref: Explaining gettext-Footnote-1896996 -Ref: Explaining gettext-Footnote-2897181 -Node: Programmer i18n897346 -Ref: Programmer i18n-Footnote-1902295 -Node: Translator i18n902344 -Node: String Extraction903138 -Ref: String Extraction-Footnote-1904270 -Node: Printf Ordering904356 -Ref: Printf Ordering-Footnote-1907142 -Node: I18N Portability907206 -Ref: I18N Portability-Footnote-1909662 -Node: I18N Example909725 -Ref: I18N Example-Footnote-1913000 -Ref: I18N Example-Footnote-2913073 -Node: Gawk I18N913182 -Node: I18N Summary913831 -Node: Debugger915172 -Node: Debugging916172 -Node: Debugging Concepts916613 -Node: Debugging Terms918422 -Node: Awk Debugging920997 -Ref: Awk Debugging-Footnote-1921942 -Node: Sample Debugging Session922074 -Node: Debugger Invocation922608 -Node: Finding The Bug923994 -Node: List of Debugger Commands930468 -Node: Breakpoint Control931801 -Node: Debugger Execution Control935495 -Node: Viewing And Changing Data938857 -Node: Execution Stack942398 -Node: Debugger Info944035 -Node: Miscellaneous Debugger Commands948106 -Node: Readline Support953168 -Node: Limitations954064 -Node: Debugging Summary956618 -Node: Namespaces957897 -Node: Global Namespace959008 -Node: Qualified Names960406 -Node: Default Namespace961405 -Node: Changing The Namespace962146 -Node: Naming Rules963760 -Node: Internal Name Management965608 -Node: Namespace Example966650 -Node: Namespace And Features969212 -Node: Namespace Summary970647 -Node: Arbitrary Precision Arithmetic972124 -Node: Computer Arithmetic973611 -Ref: table-numeric-ranges977377 -Ref: table-floating-point-ranges977870 -Ref: Computer Arithmetic-Footnote-1978528 -Node: Math Definitions978585 -Ref: table-ieee-formats981561 -Node: MPFR features982128 -Node: FP Math Caution983846 -Ref: FP Math Caution-Footnote-1984918 -Node: Inexactness of computations985287 -Node: Inexact representation986318 -Node: Comparing FP Values987678 -Node: Errors accumulate988919 -Node: Strange values990375 -Ref: Strange values-Footnote-1992963 -Node: Getting Accuracy993068 -Node: Try To Round995778 -Node: Setting precision996677 -Ref: table-predefined-precision-strings997374 -Node: Setting the rounding mode999204 -Ref: table-gawk-rounding-modes999578 -Ref: Setting the rounding mode-Footnote-11003509 -Node: Arbitrary Precision Integers1003688 -Ref: Arbitrary Precision Integers-Footnote-11006863 -Node: Checking for MPFR1007012 -Node: POSIX Floating Point Problems1008486 -Ref: POSIX Floating Point Problems-Footnote-11012771 -Node: Floating point summary1012809 -Node: Dynamic Extensions1014999 -Node: Extension Intro1016552 -Node: Plugin License1017818 -Node: Extension Mechanism Outline1018615 -Ref: figure-load-extension1019054 -Ref: figure-register-new-function1020619 -Ref: figure-call-new-function1021711 -Node: Extension API Description1023773 -Node: Extension API Functions Introduction1025486 -Ref: table-api-std-headers1027322 -Node: General Data Types1031571 -Ref: General Data Types-Footnote-11040277 -Node: Memory Allocation Functions1040576 -Ref: Memory Allocation Functions-Footnote-11045077 -Node: Constructor Functions1045176 -Node: API Ownership of MPFR and GMP Values1048829 -Node: Registration Functions1050142 -Node: Extension Functions1050842 -Node: Exit Callback Functions1056164 -Node: Extension Version String1057414 -Node: Input Parsers1058077 -Node: Output Wrappers1070798 -Node: Two-way processors1075310 -Node: Printing Messages1077575 -Ref: Printing Messages-Footnote-11078746 -Node: Updating ERRNO1078899 -Node: Requesting Values1079638 -Ref: table-value-types-returned1080375 -Node: Accessing Parameters1081483 -Node: Symbol Table Access1082720 -Node: Symbol table by name1083232 -Ref: Symbol table by name-Footnote-11086256 -Node: Symbol table by cookie1086384 -Ref: Symbol table by cookie-Footnote-11090569 -Node: Cached values1090633 -Ref: Cached values-Footnote-11094169 -Node: Array Manipulation1094322 -Ref: Array Manipulation-Footnote-11095413 -Node: Array Data Types1095450 -Ref: Array Data Types-Footnote-11098108 -Node: Array Functions1098200 -Node: Flattening Arrays1102698 -Node: Creating Arrays1109674 -Node: Redirection API1114441 -Node: Extension API Variables1117274 -Node: Extension Versioning1117985 -Ref: gawk-api-version1118414 -Node: Extension GMP/MPFR Versioning1120145 -Node: Extension API Informational Variables1121773 -Node: Extension API Boilerplate1122846 -Node: Changes from API V11126820 -Node: Finding Extensions1128392 -Node: Extension Example1128951 -Node: Internal File Description1129749 -Node: Internal File Ops1133829 -Ref: Internal File Ops-Footnote-11145179 -Node: Using Internal File Ops1145319 -Ref: Using Internal File Ops-Footnote-11147702 -Node: Extension Samples1147976 -Node: Extension Sample File Functions1149505 -Node: Extension Sample Fnmatch1157154 -Node: Extension Sample Fork1158641 -Node: Extension Sample Inplace1159859 -Node: Extension Sample Ord1163485 -Node: Extension Sample Readdir1164321 -Ref: table-readdir-file-types1165210 -Node: Extension Sample Revout1166277 -Node: Extension Sample Rev2way1166866 -Node: Extension Sample Read write array1167606 -Node: Extension Sample Readfile1169548 -Node: Extension Sample Time1170643 -Node: Extension Sample API Tests1172395 -Node: gawkextlib1172887 -Node: Extension summary1175805 -Node: Extension Exercises1179507 -Node: Language History1180749 -Node: V7/SVR3.11182405 -Node: SVR41184557 -Node: POSIX1185991 -Node: BTL1187372 -Node: POSIX/GNU1188101 -Node: Feature History1193879 -Node: Common Extensions1210198 -Node: Ranges and Locales1211481 -Ref: Ranges and Locales-Footnote-11216097 -Ref: Ranges and Locales-Footnote-21216124 -Ref: Ranges and Locales-Footnote-31216359 -Node: Contributors1216582 -Node: History summary1222579 -Node: Installation1223959 -Node: Gawk Distribution1224903 -Node: Getting1225387 -Node: Extracting1226350 -Node: Distribution contents1227988 -Node: Unix Installation1234468 -Node: Quick Installation1235150 -Node: Shell Startup Files1237564 -Node: Additional Configuration Options1238653 -Node: Configuration Philosophy1240968 -Node: Non-Unix Installation1243337 -Node: PC Installation1243797 -Node: PC Binary Installation1244635 -Node: PC Compiling1245070 -Node: PC Using1246187 -Node: Cygwin1249740 -Node: MSYS1250964 -Node: VMS Installation1251566 -Node: VMS Compilation1252357 -Ref: VMS Compilation-Footnote-11253586 -Node: VMS Dynamic Extensions1253644 -Node: VMS Installation Details1255329 -Node: VMS Running1257582 -Node: VMS GNV1261861 -Node: VMS Old Gawk1262596 -Node: Bugs1263067 -Node: Bug address1263730 -Node: Usenet1266712 -Node: Maintainers1267716 -Node: Other Versions1268901 -Node: Installation summary1276766 -Node: Notes1277975 -Node: Compatibility Mode1278769 -Node: Additions1279551 -Node: Accessing The Source1280476 -Node: Adding Code1281913 -Node: New Ports1288132 -Node: Derived Files1292507 -Ref: Derived Files-Footnote-11298167 -Ref: Derived Files-Footnote-21298202 -Ref: Derived Files-Footnote-31298800 -Node: Future Extensions1298914 -Node: Implementation Limitations1299572 -Node: Extension Design1300782 -Node: Old Extension Problems1301926 -Ref: Old Extension Problems-Footnote-11303444 -Node: Extension New Mechanism Goals1303501 -Ref: Extension New Mechanism Goals-Footnote-11306865 -Node: Extension Other Design Decisions1307054 -Node: Extension Future Growth1309167 -Node: Notes summary1309773 -Node: Basic Concepts1310931 -Node: Basic High Level1311612 -Ref: figure-general-flow1311894 -Ref: figure-process-flow1312579 -Ref: Basic High Level-Footnote-11315880 -Node: Basic Data Typing1316065 -Node: Glossary1319393 -Node: Copying1351278 -Node: GNU Free Documentation License1388821 -Node: Index1413941 +Node: Foreword345044 +Node: Foreword449486 +Node: Preface51018 +Ref: Preface-Footnote-153877 +Ref: Preface-Footnote-253986 +Ref: Preface-Footnote-354220 +Node: History54362 +Node: Names56714 +Ref: Names-Footnote-157818 +Node: This Manual57965 +Ref: This Manual-Footnote-164604 +Node: Conventions64704 +Node: Manual History67073 +Ref: Manual History-Footnote-170070 +Ref: Manual History-Footnote-270111 +Node: How To Contribute70185 +Node: Acknowledgments71111 +Node: Getting Started76048 +Node: Running gawk78487 +Node: One-shot79677 +Node: Read Terminal80940 +Node: Long82933 +Node: Executable Scripts84446 +Ref: Executable Scripts-Footnote-187079 +Node: Comments87182 +Node: Quoting89666 +Node: DOS Quoting95192 +Node: Sample Data Files97248 +Node: Very Simple99843 +Node: Two Rules105945 +Node: More Complex107830 +Node: Statements/Lines110162 +Ref: Statements/Lines-Footnote-1114646 +Node: Other Features114911 +Node: When115847 +Ref: When-Footnote-1117601 +Node: Intro Summary117666 +Node: Invoking Gawk118550 +Node: Command Line120064 +Node: Options120862 +Ref: Options-Footnote-1138776 +Ref: Options-Footnote-2139007 +Node: Other Arguments139032 +Node: Naming Standard Input143043 +Node: Environment Variables144253 +Node: AWKPATH Variable144811 +Ref: AWKPATH Variable-Footnote-1148223 +Ref: AWKPATH Variable-Footnote-2148257 +Node: AWKLIBPATH Variable148628 +Ref: AWKLIBPATH Variable-Footnote-1150325 +Node: Other Environment Variables150700 +Node: Exit Status154652 +Node: Include Files155329 +Node: Loading Shared Libraries159019 +Node: Obsolete160447 +Node: Undocumented161139 +Node: Invoking Summary161436 +Node: Regexp164277 +Node: Regexp Usage165731 +Node: Escape Sequences167768 +Node: Regexp Operators174009 +Node: Regexp Operator Details174494 +Ref: Regexp Operator Details-Footnote-1181858 +Node: Interval Expressions182005 +Ref: Interval Expressions-Footnote-1183426 +Node: Bracket Expressions183524 +Ref: table-char-classes186000 +Node: Leftmost Longest189326 +Node: Computed Regexps190629 +Node: GNU Regexp Operators194056 +Node: Case-sensitivity197793 +Ref: Case-sensitivity-Footnote-1200659 +Ref: Case-sensitivity-Footnote-2200894 +Node: Regexp Summary201002 +Node: Reading Files202468 +Node: Records204737 +Node: awk split records205812 +Node: gawk split records210512 +Ref: gawk split records-Footnote-1215586 +Node: Fields215623 +Node: Nonconstant Fields218364 +Ref: Nonconstant Fields-Footnote-1220600 +Node: Changing Fields220804 +Node: Field Separators226835 +Node: Default Field Splitting229533 +Node: Regexp Field Splitting230651 +Node: Single Character Fields234328 +Node: Command Line Field Separator235388 +Node: Full Line Fields238606 +Ref: Full Line Fields-Footnote-1240128 +Ref: Full Line Fields-Footnote-2240174 +Node: Field Splitting Summary240275 +Node: Constant Size242349 +Node: Fixed width data243081 +Node: Skipping intervening246548 +Node: Allowing trailing data247346 +Node: Fields with fixed data248383 +Node: Splitting By Content249901 +Ref: Splitting By Content-Footnote-1253684 +Node: More CSV253847 +Node: Testing field creation255439 +Node: Multiple Line257064 +Node: Getline263341 +Node: Plain Getline265810 +Node: Getline/Variable268383 +Node: Getline/File269534 +Node: Getline/Variable/File270922 +Ref: Getline/Variable/File-Footnote-1272527 +Node: Getline/Pipe272615 +Node: Getline/Variable/Pipe275319 +Node: Getline/Coprocess276454 +Node: Getline/Variable/Coprocess277721 +Node: Getline Notes278463 +Node: Getline Summary281260 +Ref: table-getline-variants281684 +Node: Read Timeout282432 +Ref: Read Timeout-Footnote-1286338 +Node: Retrying Input286396 +Node: Command-line directories287595 +Node: Input Summary288501 +Node: Input Exercises291673 +Node: Printing292107 +Node: Print293941 +Node: Print Examples295398 +Node: Output Separators298178 +Node: OFMT300195 +Node: Printf301551 +Node: Basic Printf302336 +Node: Control Letters303910 +Node: Format Modifiers309072 +Node: Printf Examples315087 +Node: Redirection317573 +Node: Special FD324414 +Ref: Special FD-Footnote-1327582 +Node: Special Files327656 +Node: Other Inherited Files328273 +Node: Special Network329274 +Node: Special Caveats330134 +Node: Close Files And Pipes331083 +Ref: table-close-pipe-return-values337990 +Ref: Close Files And Pipes-Footnote-1338803 +Ref: Close Files And Pipes-Footnote-2338951 +Node: Nonfatal339103 +Node: Output Summary341441 +Node: Output Exercises342663 +Node: Expressions343342 +Node: Values344530 +Node: Constants345208 +Node: Scalar Constants345899 +Ref: Scalar Constants-Footnote-1348409 +Node: Nondecimal-numbers348659 +Node: Regexp Constants351660 +Node: Using Constant Regexps352186 +Node: Standard Regexp Constants352808 +Node: Strong Regexp Constants355996 +Node: Variables359008 +Node: Using Variables359665 +Node: Assignment Options361575 +Node: Conversion364046 +Node: Strings And Numbers364570 +Ref: Strings And Numbers-Footnote-1367633 +Node: Locale influences conversions367742 +Ref: table-locale-affects370500 +Node: All Operators371118 +Node: Arithmetic Ops371747 +Node: Concatenation374463 +Ref: Concatenation-Footnote-1377310 +Node: Assignment Ops377417 +Ref: table-assign-ops382408 +Node: Increment Ops383721 +Node: Truth Values and Conditions387181 +Node: Truth Values388255 +Node: Typing and Comparison389303 +Node: Variable Typing390123 +Ref: Variable Typing-Footnote-1396586 +Ref: Variable Typing-Footnote-2396658 +Node: Comparison Operators396735 +Ref: table-relational-ops397154 +Node: POSIX String Comparison400649 +Ref: POSIX String Comparison-Footnote-1402344 +Ref: POSIX String Comparison-Footnote-2402483 +Node: Boolean Ops402567 +Ref: Boolean Ops-Footnote-1407049 +Node: Conditional Exp407141 +Node: Function Calls408877 +Node: Precedence412754 +Node: Locales416413 +Node: Expressions Summary418045 +Node: Patterns and Actions420618 +Node: Pattern Overview421738 +Node: Regexp Patterns423415 +Node: Expression Patterns423957 +Node: Ranges427738 +Node: BEGIN/END430846 +Node: Using BEGIN/END431607 +Ref: Using BEGIN/END-Footnote-1434361 +Node: I/O And BEGIN/END434467 +Node: BEGINFILE/ENDFILE436780 +Node: Empty440011 +Node: Using Shell Variables440328 +Node: Action Overview442602 +Node: Statements444927 +Node: If Statement446775 +Node: While Statement448270 +Node: Do Statement450298 +Node: For Statement451446 +Node: Switch Statement454617 +Node: Break Statement457058 +Node: Continue Statement459150 +Node: Next Statement460977 +Node: Nextfile Statement463360 +Node: Exit Statement466049 +Node: Built-in Variables468452 +Node: User-modified469585 +Node: Auto-set477352 +Ref: Auto-set-Footnote-1494159 +Ref: Auto-set-Footnote-2494365 +Node: ARGC and ARGV494421 +Node: Pattern Action Summary498634 +Node: Arrays501064 +Node: Array Basics502393 +Node: Array Intro503237 +Ref: figure-array-elements505212 +Ref: Array Intro-Footnote-1507916 +Node: Reference to Elements508044 +Node: Assigning Elements510508 +Node: Array Example510999 +Node: Scanning an Array512758 +Node: Controlling Scanning515780 +Ref: Controlling Scanning-Footnote-1522236 +Node: Numeric Array Subscripts522552 +Node: Uninitialized Subscripts524736 +Node: Delete526355 +Ref: Delete-Footnote-1529107 +Node: Multidimensional529164 +Node: Multiscanning532259 +Node: Arrays of Arrays533850 +Node: Arrays Summary538618 +Node: Functions540711 +Node: Built-in541749 +Node: Calling Built-in542902 +Node: Boolean Functions544898 +Node: Numeric Functions545211 +Ref: Numeric Functions-Footnote-1549238 +Ref: Numeric Functions-Footnote-2549886 +Ref: Numeric Functions-Footnote-3549934 +Node: String Functions550206 +Ref: String Functions-Footnote-1574347 +Ref: String Functions-Footnote-2574475 +Ref: String Functions-Footnote-3574723 +Node: Gory Details574810 +Ref: table-sub-escapes576601 +Ref: table-sub-proposed578120 +Ref: table-posix-sub579483 +Ref: table-gensub-escapes581024 +Ref: Gory Details-Footnote-1581847 +Node: I/O Functions582001 +Ref: table-system-return-values588455 +Ref: I/O Functions-Footnote-1590535 +Ref: I/O Functions-Footnote-2590683 +Node: Time Functions590803 +Ref: Time Functions-Footnote-1601474 +Ref: Time Functions-Footnote-2601542 +Ref: Time Functions-Footnote-3601700 +Ref: Time Functions-Footnote-4601811 +Ref: Time Functions-Footnote-5601923 +Ref: Time Functions-Footnote-6602150 +Node: Bitwise Functions602416 +Ref: table-bitwise-ops603010 +Ref: Bitwise Functions-Footnote-1609073 +Ref: Bitwise Functions-Footnote-2609246 +Node: Type Functions609437 +Node: I18N Functions612300 +Node: User-defined613951 +Node: Definition Syntax614763 +Ref: Definition Syntax-Footnote-1620457 +Node: Function Example620528 +Ref: Function Example-Footnote-1623450 +Node: Function Calling623472 +Node: Calling A Function624060 +Node: Variable Scope625018 +Node: Pass By Value/Reference628012 +Node: Function Caveats630656 +Ref: Function Caveats-Footnote-1632703 +Node: Return Statement632823 +Node: Dynamic Typing635802 +Node: Indirect Calls636732 +Ref: Indirect Calls-Footnote-1646987 +Node: Functions Summary647115 +Node: Library Functions649820 +Ref: Library Functions-Footnote-1653427 +Ref: Library Functions-Footnote-2653570 +Node: Library Names653741 +Ref: Library Names-Footnote-1657408 +Ref: Library Names-Footnote-2657631 +Node: General Functions657717 +Node: Strtonum Function658820 +Node: Assert Function661842 +Node: Round Function665168 +Node: Cliff Random Function666708 +Node: Ordinal Functions667724 +Ref: Ordinal Functions-Footnote-1670787 +Ref: Ordinal Functions-Footnote-2671039 +Node: Join Function671249 +Ref: Join Function-Footnote-1673019 +Node: Getlocaltime Function673219 +Node: Readfile Function676961 +Node: Shell Quoting678938 +Node: Data File Management680339 +Node: Filetrans Function680971 +Node: Rewind Function685067 +Node: File Checking686976 +Ref: File Checking-Footnote-1688310 +Node: Empty Files688511 +Node: Ignoring Assigns690490 +Node: Getopt Function692040 +Ref: Getopt Function-Footnote-1707251 +Node: Passwd Functions707451 +Ref: Passwd Functions-Footnote-1716290 +Node: Group Functions716378 +Ref: Group Functions-Footnote-1724276 +Node: Walking Arrays724483 +Node: Library Functions Summary727491 +Node: Library Exercises728897 +Node: Sample Programs729362 +Node: Running Examples730132 +Node: Clones730860 +Node: Cut Program732084 +Node: Egrep Program742224 +Node: Id Program751225 +Node: Split Program761172 +Ref: Split Program-Footnote-1771062 +Node: Tee Program771235 +Node: Uniq Program774025 +Node: Wc Program781613 +Node: Bytes vs. Characters782000 +Node: Using extensions783548 +Node: wc program784302 +Node: Miscellaneous Programs789167 +Node: Dupword Program790380 +Node: Alarm Program792410 +Node: Translate Program797265 +Ref: Translate Program-Footnote-1801830 +Node: Labels Program802100 +Ref: Labels Program-Footnote-1805451 +Node: Word Sorting805535 +Node: History Sorting809607 +Node: Extract Program811832 +Node: Simple Sed819886 +Node: Igawk Program822960 +Ref: Igawk Program-Footnote-1837291 +Ref: Igawk Program-Footnote-2837493 +Ref: Igawk Program-Footnote-3837615 +Node: Anagram Program837730 +Node: Signature Program840792 +Node: Programs Summary842039 +Node: Programs Exercises843253 +Ref: Programs Exercises-Footnote-1847383 +Node: Advanced Features847469 +Node: Nondecimal Data849593 +Node: Boolean Typed Values851191 +Node: Array Sorting852815 +Node: Controlling Array Traversal853520 +Ref: Controlling Array Traversal-Footnote-1861888 +Node: Array Sorting Functions862006 +Ref: Array Sorting Functions-Footnote-1867097 +Node: Two-way I/O867293 +Ref: Two-way I/O-Footnote-1875014 +Ref: Two-way I/O-Footnote-2875201 +Node: TCP/IP Networking875283 +Node: Profiling878401 +Node: Extension Philosophy887710 +Node: Advanced Features Summary889189 +Node: Internationalization891204 +Node: I18N and L10N892684 +Node: Explaining gettext893371 +Ref: Explaining gettext-Footnote-1899263 +Ref: Explaining gettext-Footnote-2899448 +Node: Programmer i18n899613 +Ref: Programmer i18n-Footnote-1904562 +Node: Translator i18n904611 +Node: String Extraction905405 +Ref: String Extraction-Footnote-1906537 +Node: Printf Ordering906623 +Ref: Printf Ordering-Footnote-1909409 +Node: I18N Portability909473 +Ref: I18N Portability-Footnote-1911929 +Node: I18N Example911992 +Ref: I18N Example-Footnote-1915267 +Ref: I18N Example-Footnote-2915340 +Node: Gawk I18N915449 +Node: I18N Summary916098 +Node: Debugger917439 +Node: Debugging918439 +Node: Debugging Concepts918880 +Node: Debugging Terms920689 +Node: Awk Debugging923264 +Ref: Awk Debugging-Footnote-1924209 +Node: Sample Debugging Session924341 +Node: Debugger Invocation924875 +Node: Finding The Bug926261 +Node: List of Debugger Commands932735 +Node: Breakpoint Control934068 +Node: Debugger Execution Control937762 +Node: Viewing And Changing Data941124 +Node: Execution Stack944665 +Node: Debugger Info946302 +Node: Miscellaneous Debugger Commands950373 +Node: Readline Support955435 +Node: Limitations956331 +Node: Debugging Summary958885 +Node: Namespaces960164 +Node: Global Namespace961275 +Node: Qualified Names962673 +Node: Default Namespace963672 +Node: Changing The Namespace964413 +Node: Naming Rules966027 +Node: Internal Name Management967875 +Node: Namespace Example968917 +Node: Namespace And Features971479 +Node: Namespace Summary972914 +Node: Arbitrary Precision Arithmetic974391 +Node: Computer Arithmetic975878 +Ref: table-numeric-ranges979644 +Ref: table-floating-point-ranges980137 +Ref: Computer Arithmetic-Footnote-1980795 +Node: Math Definitions980852 +Ref: table-ieee-formats983828 +Node: MPFR features984395 +Node: FP Math Caution986113 +Ref: FP Math Caution-Footnote-1987185 +Node: Inexactness of computations987554 +Node: Inexact representation988585 +Node: Comparing FP Values989945 +Node: Errors accumulate991186 +Node: Strange values992642 +Ref: Strange values-Footnote-1995230 +Node: Getting Accuracy995335 +Node: Try To Round998045 +Node: Setting precision998944 +Ref: table-predefined-precision-strings999641 +Node: Setting the rounding mode1001471 +Ref: table-gawk-rounding-modes1001845 +Ref: Setting the rounding mode-Footnote-11005776 +Node: Arbitrary Precision Integers1005955 +Ref: Arbitrary Precision Integers-Footnote-11009130 +Node: Checking for MPFR1009279 +Node: POSIX Floating Point Problems1010753 +Ref: POSIX Floating Point Problems-Footnote-11015038 +Node: Floating point summary1015076 +Node: Dynamic Extensions1017266 +Node: Extension Intro1018819 +Node: Plugin License1020085 +Node: Extension Mechanism Outline1020882 +Ref: figure-load-extension1021321 +Ref: figure-register-new-function1022886 +Ref: figure-call-new-function1023978 +Node: Extension API Description1026040 +Node: Extension API Functions Introduction1027753 +Ref: table-api-std-headers1029589 +Node: General Data Types1033838 +Ref: General Data Types-Footnote-11042544 +Node: Memory Allocation Functions1042843 +Ref: Memory Allocation Functions-Footnote-11047344 +Node: Constructor Functions1047443 +Node: API Ownership of MPFR and GMP Values1051096 +Node: Registration Functions1052409 +Node: Extension Functions1053109 +Node: Exit Callback Functions1058431 +Node: Extension Version String1059681 +Node: Input Parsers1060344 +Node: Output Wrappers1073065 +Node: Two-way processors1077577 +Node: Printing Messages1079842 +Ref: Printing Messages-Footnote-11081013 +Node: Updating ERRNO1081166 +Node: Requesting Values1081905 +Ref: table-value-types-returned1082642 +Node: Accessing Parameters1083750 +Node: Symbol Table Access1084987 +Node: Symbol table by name1085499 +Ref: Symbol table by name-Footnote-11088523 +Node: Symbol table by cookie1088651 +Ref: Symbol table by cookie-Footnote-11092836 +Node: Cached values1092900 +Ref: Cached values-Footnote-11096436 +Node: Array Manipulation1096589 +Ref: Array Manipulation-Footnote-11097680 +Node: Array Data Types1097717 +Ref: Array Data Types-Footnote-11100375 +Node: Array Functions1100467 +Node: Flattening Arrays1104965 +Node: Creating Arrays1111941 +Node: Redirection API1116708 +Node: Extension API Variables1119541 +Node: Extension Versioning1120252 +Ref: gawk-api-version1120681 +Node: Extension GMP/MPFR Versioning1122412 +Node: Extension API Informational Variables1124040 +Node: Extension API Boilerplate1125113 +Node: Changes from API V11129087 +Node: Finding Extensions1130659 +Node: Extension Example1131218 +Node: Internal File Description1132016 +Node: Internal File Ops1136096 +Ref: Internal File Ops-Footnote-11147446 +Node: Using Internal File Ops1147586 +Ref: Using Internal File Ops-Footnote-11149969 +Node: Extension Samples1150243 +Node: Extension Sample File Functions1151772 +Node: Extension Sample Fnmatch1159421 +Node: Extension Sample Fork1160908 +Node: Extension Sample Inplace1162126 +Node: Extension Sample Ord1165752 +Node: Extension Sample Readdir1166588 +Ref: table-readdir-file-types1167477 +Node: Extension Sample Revout1168544 +Node: Extension Sample Rev2way1169133 +Node: Extension Sample Read write array1169873 +Node: Extension Sample Readfile1171815 +Node: Extension Sample Time1172910 +Node: Extension Sample API Tests1174662 +Node: gawkextlib1175154 +Node: Extension summary1178072 +Node: Extension Exercises1181774 +Node: Language History1183016 +Node: V7/SVR3.11184672 +Node: SVR41186824 +Node: POSIX1188258 +Node: BTL1189639 +Node: POSIX/GNU1190368 +Node: Feature History1196146 +Node: Common Extensions1212465 +Node: Ranges and Locales1213748 +Ref: Ranges and Locales-Footnote-11218364 +Ref: Ranges and Locales-Footnote-21218391 +Ref: Ranges and Locales-Footnote-31218626 +Node: Contributors1218849 +Node: History summary1224846 +Node: Installation1226226 +Node: Gawk Distribution1227170 +Node: Getting1227654 +Node: Extracting1228617 +Node: Distribution contents1230255 +Node: Unix Installation1236735 +Node: Quick Installation1237417 +Node: Shell Startup Files1239831 +Node: Additional Configuration Options1240920 +Node: Configuration Philosophy1243235 +Node: Non-Unix Installation1245604 +Node: PC Installation1246064 +Node: PC Binary Installation1246902 +Node: PC Compiling1247337 +Node: PC Using1248454 +Node: Cygwin1252007 +Node: MSYS1253231 +Node: VMS Installation1253833 +Node: VMS Compilation1254624 +Ref: VMS Compilation-Footnote-11255853 +Node: VMS Dynamic Extensions1255911 +Node: VMS Installation Details1257596 +Node: VMS Running1259849 +Node: VMS GNV1264128 +Node: VMS Old Gawk1264863 +Node: Bugs1265334 +Node: Bug address1265997 +Node: Usenet1268979 +Node: Maintainers1269983 +Node: Other Versions1271168 +Node: Installation summary1279033 +Node: Notes1280242 +Node: Compatibility Mode1281036 +Node: Additions1281818 +Node: Accessing The Source1282743 +Node: Adding Code1284180 +Node: New Ports1290399 +Node: Derived Files1294774 +Ref: Derived Files-Footnote-11300434 +Ref: Derived Files-Footnote-21300469 +Ref: Derived Files-Footnote-31301067 +Node: Future Extensions1301181 +Node: Implementation Limitations1301839 +Node: Extension Design1303049 +Node: Old Extension Problems1304193 +Ref: Old Extension Problems-Footnote-11305711 +Node: Extension New Mechanism Goals1305768 +Ref: Extension New Mechanism Goals-Footnote-11309132 +Node: Extension Other Design Decisions1309321 +Node: Extension Future Growth1311434 +Node: Notes summary1312040 +Node: Basic Concepts1313198 +Node: Basic High Level1313879 +Ref: figure-general-flow1314161 +Ref: figure-process-flow1314846 +Ref: Basic High Level-Footnote-11318147 +Node: Basic Data Typing1318332 +Node: Glossary1321660 +Node: Copying1353545 +Node: GNU Free Documentation License1391088 +Node: Index1416208 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 88b0a2ca..280b3168 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -754,6 +754,8 @@ particular records in a file and perform operations upon them. * Arrays Summary:: Summary of arrays. * Built-in:: Summarizes the built-in functions. * Calling Built-in:: How to call built-in functions. +* Boolean Functions:: A function that returns Boolean + values. * Numeric Functions:: Functions that work with numbers, including @code{int()}, @code{sin()} and @code{rand()}. @@ -861,6 +863,7 @@ particular records in a file and perform operations upon them. * Programs Summary:: Summary of programs. * Programs Exercises:: Exercises. * Nondecimal Data:: Allowing nondecimal input data. +* Boolean Typed Values:: Values with @code{bool} type. * Array Sorting:: Facilities for controlling array traversal and sorting arrays. * Controlling Array Traversal:: How to use PROCINFO["sorted_in"]. @@ -18307,6 +18310,7 @@ but are summarized here for your convenience. @menu * Calling Built-in:: How to call built-in functions. +* Boolean Functions:: A function that returns Boolean values. * Numeric Functions:: Functions that work with numbers, including @code{int()}, @code{sin()} and @code{rand()}. * String Functions:: Functions for string manipulation, such as @@ -18376,6 +18380,22 @@ and 12. But if the order of evaluation is right to left, @code{i} first becomes 10, then 11, and @code{atan2()} is called with the two arguments 11 and 10. + +@node Boolean Functions +@subsection Generating Boolean Values +@cindex boolean function + +This functions is specific to @command{gawk}. It is not +available in compatibility mode (@pxref{Options}): + +@c @asis for docbook +@table @asis +@item @code{bool(@var{expression})} +@cindexgawkfunc{bool} + +blah blah +@end table + @node Numeric Functions @subsection Numeric Functions @cindex numeric @subentry functions @@ -21776,7 +21796,7 @@ being aware of them. @cindex pointers to functions @cindex differences in @command{awk} and @command{gawk} @subentry indirect function calls -This section describes an advanced, @command{gawk}-specific extension. +This @value{SECTION} describes an advanced, @command{gawk}-specific extension. Often, you may wish to defer the choice of function to call until runtime. For example, you may have different kinds of records, each of which @@ -29385,6 +29405,7 @@ discusses the ability to dynamically add new built-in functions to @menu * Nondecimal Data:: Allowing nondecimal input data. +* Boolean Typed Values:: Values with @code{bool} type. * Array Sorting:: Facilities for controlling array traversal and sorting arrays. * Two-way I/O:: Two-way communications with another process. @@ -29451,6 +29472,42 @@ leads to less surprising results. This option may disappear in a future version of @command{gawk}. @end quotation +@node Boolean Typed Values +@section Boolean Typed Values + +This @value{SECTION} describes an advanced, @command{gawk}-specific extension. + +Scalar values in @command{awk} are either numbers or strings. +@command{gawk} also supports values of type @code{regexp} (FIXME pxref). + +As seen in FIXME @@ref@{@} here, Boolean values in @command{awk} don't have a separate +type: a value counts as ``true'' if it is nonzero or non-null, and as +``false'' otherwise. + +When interchanging data with languages that do have a real Boolean type, +using a standard format such as JSON or XML, the lack of a true Boolean +type in @command{awk} is problematic. (FIXME: xref to gawkextlib json +extension) + +It's easy to import Boolean data into @command{awk}, but then the fact +that it was originally Boolean is lost. Exporting data is even harder; +there's no way to indicate that a value is really Boolean. + +To solve this problem, @command{gawk} provides a function named @code{bool()}. +It takes one argument, which is any @command{awk} expression, and it +returns a value of Boolean type. + +The returned values are different than +normal @command{awk} values. When treated as numbers, they are either +one or zero, depending upon the truth value of the expression passed +in the call. When treated as strings, they are either @code{"TRUE"} +or @code{"FALSE"}, again depending upon the truth value of the expression passed +in the call. The value for ``false'' is thus unusual; it is zero numerically, +but not empty when treated as a string. + +The @code{typeof()} function (FIXME pxref here) returns @code{"bool"} +for these values. + @node Array Sorting @section Controlling Array Traversal and Array Sorting diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 598d6a1b..6937cec6 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -749,6 +749,8 @@ particular records in a file and perform operations upon them. * Arrays Summary:: Summary of arrays. * Built-in:: Summarizes the built-in functions. * Calling Built-in:: How to call built-in functions. +* Boolean Functions:: A function that returns Boolean + values. * Numeric Functions:: Functions that work with numbers, including @code{int()}, @code{sin()} and @code{rand()}. @@ -856,6 +858,7 @@ particular records in a file and perform operations upon them. * Programs Summary:: Summary of programs. * Programs Exercises:: Exercises. * Nondecimal Data:: Allowing nondecimal input data. +* Boolean Typed Values:: Values with @code{bool} type. * Array Sorting:: Facilities for controlling array traversal and sorting arrays. * Controlling Array Traversal:: How to use PROCINFO["sorted_in"]. @@ -17448,6 +17451,7 @@ but are summarized here for your convenience. @menu * Calling Built-in:: How to call built-in functions. +* Boolean Functions:: A function that returns Boolean values. * Numeric Functions:: Functions that work with numbers, including @code{int()}, @code{sin()} and @code{rand()}. * String Functions:: Functions for string manipulation, such as @@ -17517,6 +17521,22 @@ and 12. But if the order of evaluation is right to left, @code{i} first becomes 10, then 11, and @code{atan2()} is called with the two arguments 11 and 10. + +@node Boolean Functions +@subsection Generating Boolean Values +@cindex boolean function + +This functions is specific to @command{gawk}. It is not +available in compatibility mode (@pxref{Options}): + +@c @asis for docbook +@table @asis +@item @code{bool(@var{expression})} +@cindexgawkfunc{bool} + +blah blah +@end table + @node Numeric Functions @subsection Numeric Functions @cindex numeric @subentry functions @@ -20688,7 +20708,7 @@ being aware of them. @cindex pointers to functions @cindex differences in @command{awk} and @command{gawk} @subentry indirect function calls -This section describes an advanced, @command{gawk}-specific extension. +This @value{SECTION} describes an advanced, @command{gawk}-specific extension. Often, you may wish to defer the choice of function to call until runtime. For example, you may have different kinds of records, each of which @@ -28267,6 +28287,7 @@ discusses the ability to dynamically add new built-in functions to @menu * Nondecimal Data:: Allowing nondecimal input data. +* Boolean Typed Values:: Values with @code{bool} type. * Array Sorting:: Facilities for controlling array traversal and sorting arrays. * Two-way I/O:: Two-way communications with another process. @@ -28333,6 +28354,42 @@ leads to less surprising results. This option may disappear in a future version of @command{gawk}. @end quotation +@node Boolean Typed Values +@section Boolean Typed Values + +This @value{SECTION} describes an advanced, @command{gawk}-specific extension. + +Scalar values in @command{awk} are either numbers or strings. +@command{gawk} also supports values of type @code{regexp} (FIXME pxref). + +As seen in FIXME @@ref@{@} here, Boolean values in @command{awk} don't have a separate +type: a value counts as ``true'' if it is nonzero or non-null, and as +``false'' otherwise. + +When interchanging data with languages that do have a real Boolean type, +using a standard format such as JSON or XML, the lack of a true Boolean +type in @command{awk} is problematic. (FIXME: xref to gawkextlib json +extension) + +It's easy to import Boolean data into @command{awk}, but then the fact +that it was originally Boolean is lost. Exporting data is even harder; +there's no way to indicate that a value is really Boolean. + +To solve this problem, @command{gawk} provides a function named @code{bool()}. +It takes one argument, which is any @command{awk} expression, and it +returns a value of Boolean type. + +The returned values are different than +normal @command{awk} values. When treated as numbers, they are either +one or zero, depending upon the truth value of the expression passed +in the call. When treated as strings, they are either @code{"TRUE"} +or @code{"FALSE"}, again depending upon the truth value of the expression passed +in the call. The value for ``false'' is thus unusual; it is zero numerically, +but not empty when treated as a string. + +The @code{typeof()} function (FIXME pxref here) returns @code{"bool"} +for these values. + @node Array Sorting @section Controlling Array Traversal and Array Sorting |