diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ChangeLog | 4 | ||||
-rw-r--r-- | doc/gawk.info | 1171 | ||||
-rw-r--r-- | doc/gawk.texi | 55 | ||||
-rw-r--r-- | doc/gawktexi.in | 26 |
4 files changed, 684 insertions, 572 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog index 8da64d31..be3dead2 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-06-18 Arnold D. Robbins <arnold@skeeve.com> + + * gawktexi.in: Split 6.1.4 into subsections. Other minor fixes. + 2014-06-17 Arnold D. Robbins <arnold@skeeve.com> * gawktexi.in: Finish adding exerices. diff --git a/doc/gawk.info b/doc/gawk.info index a7d489bd..cf5c6036 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -266,6 +266,9 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) This is an advanced method of input. * Conversion:: The conversion of strings to numbers and vice versa. +* Strings And Numbers:: How `awk' Converts Between + Strings And Numbers. +* Locale influences conversions:: How the locale may affect conversions. * All Operators:: `gawk''s operators. * Arithmetic Ops:: Arithmetic operations (`+', `-', etc.) @@ -7461,6 +7464,22 @@ File: gawk.info, Node: Conversion, Prev: Variables, Up: Values 6.1.4 Conversion of Strings and Numbers --------------------------------------- +Number to string and string to number conversion are generally +straightforward. There can be subtleties to be aware of; this minor +node discusses this important facet of `awk'. + +* Menu: + +* Strings And Numbers:: How `awk' Converts Between Strings And + Numbers. +* Locale influences conversions:: How the locale may affect conversions. + + +File: gawk.info, Node: Strings And Numbers, Next: Locale influences conversions, Up: Conversion + +6.1.4.1 How `awk' Converts Between Strings And Numbers +...................................................... + Strings are converted to numbers and numbers are converted to strings, if the context of the `awk' program demands it. For example, if the value of either `foo' or `bar' in the expression `foo + bar' happens to @@ -7510,6 +7529,8 @@ value of `CONVFMT' may be. Given the following code fragment: `b' has the value `"12"', not `"12.00"'. (d.c.) + Pre-POSIX `awk' Used `OFMT' For String Conversion + Prior to the POSIX standard, `awk' used the value of `OFMT' for converting numbers to strings. `OFMT' specifies the output format to use when printing numbers with `print'. `CONVFMT' was introduced in @@ -7519,8 +7540,19 @@ printing. Both `CONVFMT' and `OFMT' have the same default value: change their behavior. *Note Print::, for more information on the `print' statement. - Where you are can matter when it comes to converting between numbers -and strings. The local character set and language--the "locale"--can + ---------- Footnotes ---------- + + (1) Pathological cases can require up to 752 digits (!), but we +doubt that you need to worry about this. + + +File: gawk.info, Node: Locale influences conversions, Prev: Strings And Numbers, Up: Conversion + +6.1.4.2 Locales Can Influence Conversion +........................................ + +Where you are can matter when it comes to converting between numbers and +strings. The local character set and language--the "locale"--can affect numeric formats. In particular, for `awk' programs, it affects the decimal point character and the thousands-separator character. The `"C"' locale, and most English-language locales, use the period @@ -7582,11 +7614,6 @@ representation can have an unusual but important effect on the way `gawk' converts some special string values to numbers. The details are presented in *note POSIX Floating Point Problems::. - ---------- Footnotes ---------- - - (1) Pathological cases can require up to 752 digits (!), but we -doubt that you need to worry about this. - File: gawk.info, Node: All Operators, Next: Truth Values and Conditions, Prev: Values, Up: Expressions @@ -8725,6 +8752,7 @@ File: gawk.info, Node: Expressions Summary, Prev: Locales, Up: Expressions * Numbers are automatically converted to strings, and strings to numbers, as needed by `awk'. Numeric values are converted as if they were formatted with `sprintf()' using the format in `CONVFMT'. + Locales can influence the conversions. * `awk' provides the usual arithmetic operators (addition, subtraction, multiplication, division, modulus), and unary plus @@ -21981,7 +22009,8 @@ integer arithmetic using GMP arbitrary precision integers. Any number that looks like an integer in a source or data file is stored as an arbitrary precision integer. The size of the integer is limited only by the available memory. For example, the following computes 5^4^3^2, -the result of which is beyond the limits of ordinary `gawk' numbers: +the result of which is beyond the limits of ordinary hardware +double-precision floating point values: $ gawk -M 'BEGIN { > x = 5^4^3^2 @@ -22069,8 +22098,8 @@ These features are: Number" (NaN), positive Infinity ("inf") and negative Infinity ("-inf"). In particular, the format for these values is as specified by the ISO 1999 C standard, which ignores case and can - allow machine-dependent additional characters after the `nan' and - allow either `inf' or `infinity'. + allow implementation-dependent additional characters after the + `nan' and allow either `inf' or `infinity'. The first problem is that both of these are clear changes to historical practice: @@ -31302,7 +31331,7 @@ Index * awk, implementations, limits: Getline Notes. (line 14) * awk, invoking: Command Line. (line 6) * awk, new vs. old: Names. (line 6) -* awk, new vs. old, OFMT variable: Conversion. (line 55) +* awk, new vs. old, OFMT variable: Strings And Numbers. (line 57) * awk, POSIX and: Preface. (line 23) * awk, POSIX and, See Also POSIX awk: Preface. (line 23) * awk, regexp constants and: Comparison Operators. @@ -31661,11 +31690,11 @@ Index (line 31) * converting, dates to timestamps: Time Functions. (line 76) * converting, numbers to strings <1>: Bitwise Functions. (line 109) -* converting, numbers to strings: Conversion. (line 6) +* converting, numbers to strings: Strings And Numbers. (line 6) * converting, strings to numbers <1>: Bitwise Functions. (line 109) -* converting, strings to numbers: Conversion. (line 6) +* converting, strings to numbers: Strings And Numbers. (line 6) * CONVFMT variable <1>: User-modified. (line 30) -* CONVFMT variable: Conversion. (line 29) +* CONVFMT variable: Strings And Numbers. (line 29) * CONVFMT variable, and array subscripts: Numeric Array Subscripts. (line 6) * cookie: Glossary. (line 149) @@ -31706,7 +31735,7 @@ Index (line 131) * dark corner, command-line arguments: Assignment Options. (line 43) * dark corner, continue statement: Continue Statement. (line 43) -* dark corner, CONVFMT variable: Conversion. (line 40) +* dark corner, CONVFMT variable: Strings And Numbers. (line 40) * dark corner, escape sequences: Other Arguments. (line 31) * dark corner, escape sequences, for metacharacters: Escape Sequences. (line 134) @@ -31722,7 +31751,8 @@ Index * dark corner, input files: awk split records. (line 110) * dark corner, invoking awk: Command Line. (line 16) * dark corner, length() function: String Functions. (line 183) -* dark corner, locale's decimal point character: Conversion. (line 75) +* dark corner, locale's decimal point character: Locale influences conversions. + (line 17) * dark corner, multiline records: Multiple Line. (line 35) * dark corner, NF variable, decrementing: Changing Fields. (line 107) * dark corner, OFMT variable: OFMT. (line 27) @@ -32898,7 +32928,8 @@ Index * null strings, and deleting array elements: Delete. (line 27) * null strings, as array subscripts: Uninitialized Subscripts. (line 43) -* null strings, converting numbers to strings: Conversion. (line 21) +* null strings, converting numbers to strings: Strings And Numbers. + (line 21) * null strings, matching: Gory Details. (line 164) * number as string of bits: Bitwise Functions. (line 109) * number of array elements: String Functions. (line 197) @@ -32911,7 +32942,7 @@ Index * numbers, Cliff random: Cliff Random Function. (line 6) * numbers, converting <1>: Bitwise Functions. (line 109) -* numbers, converting: Conversion. (line 6) +* numbers, converting: Strings And Numbers. (line 6) * numbers, converting, to strings: User-modified. (line 30) * numbers, hexadecimal: Nondecimal-numbers. (line 6) * numbers, octal: Nondecimal-numbers. (line 6) @@ -32926,7 +32957,7 @@ Index * octal numbers: Nondecimal-numbers. (line 6) * octal values, enabling interpretation of: Options. (line 211) * OFMT variable <1>: User-modified. (line 105) -* OFMT variable <2>: Conversion. (line 55) +* OFMT variable <2>: Strings And Numbers. (line 57) * OFMT variable: OFMT. (line 15) * OFMT variable, POSIX awk and: OFMT. (line 27) * OFS variable <1>: User-modified. (line 114) @@ -33063,7 +33094,7 @@ Index * portability, gettext library and: Explaining gettext. (line 11) * portability, internationalization and: I18N Portability. (line 6) * portability, length() function: String Functions. (line 176) -* portability, new awk vs. old awk: Conversion. (line 55) +* portability, new awk vs. old awk: Strings And Numbers. (line 57) * portability, next statement in user-defined functions: Pass By Value/Reference. (line 91) * portability, NF variable, decrementing: Changing Fields. (line 115) @@ -33111,7 +33142,7 @@ Index * POSIX awk, interval expressions in: Regexp Operators. (line 136) * POSIX awk, next/nextfile statements and: Next Statement. (line 45) * POSIX awk, numeric strings and: Variable Typing. (line 6) -* POSIX awk, OFMT variable and <1>: Conversion. (line 55) +* POSIX awk, OFMT variable and <1>: Strings And Numbers. (line 57) * POSIX awk, OFMT variable and: OFMT. (line 27) * POSIX awk, period (.), using: Regexp Operators. (line 51) * POSIX awk, printf format strings and: Format Modifiers. (line 159) @@ -33488,6 +33519,8 @@ Index * sidebar, Operator Evaluation Order: Increment Ops. (line 58) * sidebar, Piping into sh: Redirection. (line 140) * sidebar, Portability Issues with #!: Executable Scripts. (line 31) +* sidebar, Pre-POSIX awk Used OFMT For String Conversion: Strings And Numbers. + (line 55) * sidebar, Recipe For A Programming Language: History. (line 6) * sidebar, RS = "\0" Is Not Portable: gawk split records. (line 63) * sidebar, So Why Does gawk have BEGINFILE and ENDFILE?: Filetrans Function. @@ -33602,7 +33635,7 @@ Index * string-translation functions: I18N Functions. (line 6) * strings splitting, example: String Functions. (line 333) * strings, converting <1>: Bitwise Functions. (line 109) -* strings, converting: Conversion. (line 6) +* strings, converting: Strings And Numbers. (line 6) * strings, converting letter case: String Functions. (line 520) * strings, converting, numbers to: User-modified. (line 30) * strings, empty, See null strings: awk split records. (line 114) @@ -33738,7 +33771,7 @@ Index * Trueman, David: History. (line 30) * trunc-mod operation: Arithmetic Ops. (line 66) * truth values: Truth Values. (line 6) -* type conversion: Conversion. (line 21) +* type conversion: Strings And Numbers. (line 21) * u debugger command (alias for until): Debugger Execution Control. (line 83) * unassigned array elements: Reference to Elements. @@ -33906,550 +33939,552 @@ Index Tag Table: Node: Top1292 -Node: Foreword41827 -Node: Preface46172 -Ref: Preface-Footnote-149319 -Ref: Preface-Footnote-249426 -Node: History49658 -Node: Names52032 -Ref: Names-Footnote-153496 -Node: This Manual53569 -Ref: This Manual-Footnote-159348 -Node: Conventions59448 -Node: Manual History61604 -Ref: Manual History-Footnote-165043 -Ref: Manual History-Footnote-265084 -Node: How To Contribute65158 -Node: Acknowledgments66397 -Node: Getting Started70546 -Node: Running gawk72980 -Node: One-shot74170 -Node: Read Terminal75395 -Ref: Read Terminal-Footnote-177045 -Ref: Read Terminal-Footnote-277321 -Node: Long77492 -Node: Executable Scripts78868 -Ref: Executable Scripts-Footnote-180701 -Ref: Executable Scripts-Footnote-280803 -Node: Comments81350 -Node: Quoting83823 -Node: DOS Quoting89139 -Node: Sample Data Files89814 -Node: Very Simple92329 -Node: Two Rules96967 -Node: More Complex98861 -Ref: More Complex-Footnote-1101793 -Node: Statements/Lines101878 -Ref: Statements/Lines-Footnote-1106333 -Node: Other Features106598 -Node: When107526 -Node: Intro Summary109696 -Node: Invoking Gawk110462 -Node: Command Line111977 -Node: Options112768 -Ref: Options-Footnote-1128597 -Node: Other Arguments128622 -Node: Naming Standard Input131284 -Node: Environment Variables132378 -Node: AWKPATH Variable132936 -Ref: AWKPATH Variable-Footnote-1135808 -Ref: AWKPATH Variable-Footnote-2135853 -Node: AWKLIBPATH Variable136113 -Node: Other Environment Variables136872 -Node: Exit Status140527 -Node: Include Files141202 -Node: Loading Shared Libraries144780 -Node: Obsolete146164 -Node: Undocumented146861 -Node: Invoking Summary147128 -Node: Regexp148708 -Node: Regexp Usage150158 -Node: Escape Sequences152191 -Node: Regexp Operators157858 -Ref: Regexp Operators-Footnote-1165338 -Ref: Regexp Operators-Footnote-2165485 -Node: Bracket Expressions165583 -Ref: table-char-classes167473 -Node: GNU Regexp Operators169996 -Node: Case-sensitivity173719 -Ref: Case-sensitivity-Footnote-1176611 -Ref: Case-sensitivity-Footnote-2176846 -Node: Leftmost Longest176954 -Node: Computed Regexps178155 -Node: Regexp Summary181527 -Node: Reading Files182998 -Node: Records185090 -Node: awk split records185833 -Node: gawk split records190691 -Ref: gawk split records-Footnote-1195212 -Node: Fields195249 -Ref: Fields-Footnote-1198213 -Node: Nonconstant Fields198299 -Ref: Nonconstant Fields-Footnote-1200529 -Node: Changing Fields200731 -Node: Field Separators206685 -Node: Default Field Splitting209387 -Node: Regexp Field Splitting210504 -Node: Single Character Fields213845 -Node: Command Line Field Separator214904 -Node: Full Line Fields218246 -Ref: Full Line Fields-Footnote-1218754 -Node: Field Splitting Summary218800 -Ref: Field Splitting Summary-Footnote-1221899 -Node: Constant Size222000 -Node: Splitting By Content226607 -Ref: Splitting By Content-Footnote-1230357 -Node: Multiple Line230397 -Ref: Multiple Line-Footnote-1236253 -Node: Getline236432 -Node: Plain Getline238648 -Node: Getline/Variable240743 -Node: Getline/File241890 -Node: Getline/Variable/File243274 -Ref: Getline/Variable/File-Footnote-1244873 -Node: Getline/Pipe244960 -Node: Getline/Variable/Pipe247659 -Node: Getline/Coprocess248766 -Node: Getline/Variable/Coprocess250018 -Node: Getline Notes250755 -Node: Getline Summary253559 -Ref: table-getline-variants253967 -Node: Read Timeout254879 -Ref: Read Timeout-Footnote-1258706 -Node: Command line directories258764 -Node: Input Summary259668 -Node: Input Exercises262805 -Node: Printing263538 -Node: Print265260 -Node: Print Examples266601 -Node: Output Separators269380 -Node: OFMT271396 -Node: Printf272754 -Node: Basic Printf273660 -Node: Control Letters275199 -Node: Format Modifiers279051 -Node: Printf Examples285078 -Node: Redirection287542 -Node: Special Files294514 -Node: Special FD295045 -Ref: Special FD-Footnote-1298669 -Node: Special Network298743 -Node: Special Caveats299593 -Node: Close Files And Pipes300389 -Ref: Close Files And Pipes-Footnote-1307550 -Ref: Close Files And Pipes-Footnote-2307698 -Node: Output Summary307848 -Node: Output exercises308845 -Node: Expressions309525 -Node: Values310710 -Node: Constants311386 -Node: Scalar Constants312066 -Ref: Scalar Constants-Footnote-1312925 -Node: Nondecimal-numbers313175 -Node: Regexp Constants316175 -Node: Using Constant Regexps316650 -Node: Variables319720 -Node: Using Variables320375 -Node: Assignment Options322099 -Node: Conversion323974 -Ref: table-locale-affects329410 -Ref: Conversion-Footnote-1330034 -Node: All Operators330143 -Node: Arithmetic Ops330773 -Node: Concatenation333278 -Ref: Concatenation-Footnote-1336074 -Node: Assignment Ops336194 -Ref: table-assign-ops341177 -Node: Increment Ops342494 -Node: Truth Values and Conditions345932 -Node: Truth Values347015 -Node: Typing and Comparison348064 -Node: Variable Typing348857 -Ref: Variable Typing-Footnote-1352757 -Node: Comparison Operators352879 -Ref: table-relational-ops353289 -Node: POSIX String Comparison356839 -Ref: POSIX String Comparison-Footnote-1357923 -Node: Boolean Ops358061 -Ref: Boolean Ops-Footnote-1362131 -Node: Conditional Exp362222 -Node: Function Calls363949 -Node: Precedence367707 -Node: Locales371376 -Node: Expressions Summary373007 -Node: Patterns and Actions375504 -Node: Pattern Overview376620 -Node: Regexp Patterns378297 -Node: Expression Patterns378840 -Node: Ranges382621 -Node: BEGIN/END385727 -Node: Using BEGIN/END386489 -Ref: Using BEGIN/END-Footnote-1389225 -Node: I/O And BEGIN/END389331 -Node: BEGINFILE/ENDFILE391616 -Node: Empty394547 -Node: Using Shell Variables394864 -Node: Action Overview397147 -Node: Statements399474 -Node: If Statement401322 -Node: While Statement402820 -Node: Do Statement404864 -Node: For Statement406020 -Node: Switch Statement409172 -Node: Break Statement411275 -Node: Continue Statement413330 -Node: Next Statement415123 -Node: Nextfile Statement417513 -Node: Exit Statement420168 -Node: Built-in Variables422572 -Node: User-modified423699 -Ref: User-modified-Footnote-1431388 -Node: Auto-set431450 -Ref: Auto-set-Footnote-1444032 -Ref: Auto-set-Footnote-2444237 -Node: ARGC and ARGV444293 -Node: Pattern Action Summary448147 -Node: Arrays450370 -Node: Array Basics451919 -Node: Array Intro452745 -Ref: figure-array-elements454718 -Node: Reference to Elements457125 -Node: Assigning Elements459398 -Node: Array Example459889 -Node: Scanning an Array461621 -Node: Controlling Scanning464636 -Ref: Controlling Scanning-Footnote-1469809 -Node: Delete470125 -Ref: Delete-Footnote-1472890 -Node: Numeric Array Subscripts472947 -Node: Uninitialized Subscripts475130 -Node: Multidimensional476755 -Node: Multiscanning479848 -Node: Arrays of Arrays481437 -Node: Arrays Summary486100 -Node: Functions488205 -Node: Built-in489078 -Node: Calling Built-in490156 -Node: Numeric Functions492144 -Ref: Numeric Functions-Footnote-1495978 -Ref: Numeric Functions-Footnote-2496335 -Ref: Numeric Functions-Footnote-3496383 -Node: String Functions496652 -Ref: String Functions-Footnote-1519663 -Ref: String Functions-Footnote-2519792 -Ref: String Functions-Footnote-3520040 -Node: Gory Details520127 -Ref: table-sub-escapes521796 -Ref: table-sub-posix-92523150 -Ref: table-sub-proposed524501 -Ref: table-posix-sub525855 -Ref: table-gensub-escapes527400 -Ref: Gory Details-Footnote-1528576 -Ref: Gory Details-Footnote-2528627 -Node: I/O Functions528778 -Ref: I/O Functions-Footnote-1535901 -Node: Time Functions536048 -Ref: Time Functions-Footnote-1546512 -Ref: Time Functions-Footnote-2546580 -Ref: Time Functions-Footnote-3546738 -Ref: Time Functions-Footnote-4546849 -Ref: Time Functions-Footnote-5546961 -Ref: Time Functions-Footnote-6547188 -Node: Bitwise Functions547454 -Ref: table-bitwise-ops548016 -Ref: Bitwise Functions-Footnote-1552261 -Node: Type Functions552445 -Node: I18N Functions553587 -Node: User-defined555232 -Node: Definition Syntax556036 -Ref: Definition Syntax-Footnote-1560961 -Node: Function Example561030 -Ref: Function Example-Footnote-1563674 -Node: Function Caveats563696 -Node: Calling A Function564214 -Node: Variable Scope565169 -Node: Pass By Value/Reference568157 -Node: Return Statement571665 -Node: Dynamic Typing574649 -Node: Indirect Calls575578 -Node: Functions Summary585291 -Node: Library Functions587830 -Ref: Library Functions-Footnote-1591448 -Ref: Library Functions-Footnote-2591591 -Node: Library Names591762 -Ref: Library Names-Footnote-1595235 -Ref: Library Names-Footnote-2595455 -Node: General Functions595541 -Node: Strtonum Function596569 -Node: Assert Function599349 -Node: Round Function602675 -Node: Cliff Random Function604216 -Node: Ordinal Functions605232 -Ref: Ordinal Functions-Footnote-1608309 -Ref: Ordinal Functions-Footnote-2608561 -Node: Join Function608772 -Ref: Join Function-Footnote-1610543 -Node: Getlocaltime Function610743 -Node: Readfile Function614479 -Node: Data File Management616318 -Node: Filetrans Function616950 -Node: Rewind Function621019 -Node: File Checking622406 -Ref: File Checking-Footnote-1623538 -Node: Empty Files623739 -Node: Ignoring Assigns625718 -Node: Getopt Function627272 -Ref: Getopt Function-Footnote-1638575 -Node: Passwd Functions638778 -Ref: Passwd Functions-Footnote-1647757 -Node: Group Functions647845 -Ref: Group Functions-Footnote-1655786 -Node: Walking Arrays655999 -Node: Library Functions Summary657602 -Node: Library exercises658990 -Node: Sample Programs660270 -Node: Running Examples661040 -Node: Clones661768 -Node: Cut Program662992 -Node: Egrep Program672860 -Ref: Egrep Program-Footnote-1680831 -Node: Id Program680941 -Node: Split Program684605 -Ref: Split Program-Footnote-1688143 -Node: Tee Program688271 -Node: Uniq Program691078 -Node: Wc Program698508 -Ref: Wc Program-Footnote-1702773 -Node: Miscellaneous Programs702865 -Node: Dupword Program704078 -Node: Alarm Program706109 -Node: Translate Program710923 -Ref: Translate Program-Footnote-1715314 -Ref: Translate Program-Footnote-2715584 -Node: Labels Program715718 -Ref: Labels Program-Footnote-1719089 -Node: Word Sorting719173 -Node: History Sorting723216 -Node: Extract Program725052 -Node: Simple Sed732588 -Node: Igawk Program735650 -Ref: Igawk Program-Footnote-1749961 -Ref: Igawk Program-Footnote-2750162 -Node: Anagram Program750300 -Node: Signature Program753368 -Node: Programs Summary754615 -Node: Programs Exercises755830 -Node: Advanced Features759481 -Node: Nondecimal Data761429 -Node: Array Sorting763006 -Node: Controlling Array Traversal763703 -Node: Array Sorting Functions771983 -Ref: Array Sorting Functions-Footnote-1775890 -Node: Two-way I/O776084 -Ref: Two-way I/O-Footnote-1781600 -Node: TCP/IP Networking781682 -Node: Profiling784526 -Node: Advanced Features Summary792068 -Node: Internationalization793932 -Node: I18N and L10N795412 -Node: Explaining gettext796098 -Ref: Explaining gettext-Footnote-1801238 -Ref: Explaining gettext-Footnote-2801422 -Node: Programmer i18n801587 -Node: Translator i18n805812 -Node: String Extraction806606 -Ref: String Extraction-Footnote-1807567 -Node: Printf Ordering807653 -Ref: Printf Ordering-Footnote-1810435 -Node: I18N Portability810499 -Ref: I18N Portability-Footnote-1812948 -Node: I18N Example813011 -Ref: I18N Example-Footnote-1815733 -Node: Gawk I18N815805 -Node: I18N Summary816443 -Node: Debugger817782 -Node: Debugging818804 -Node: Debugging Concepts819245 -Node: Debugging Terms821101 -Node: Awk Debugging823698 -Node: Sample Debugging Session824590 -Node: Debugger Invocation825110 -Node: Finding The Bug826443 -Node: List of Debugger Commands832925 -Node: Breakpoint Control834257 -Node: Debugger Execution Control837921 -Node: Viewing And Changing Data841281 -Node: Execution Stack844639 -Node: Debugger Info846152 -Node: Miscellaneous Debugger Commands850146 -Node: Readline Support855330 -Node: Limitations856222 -Node: Debugging Summary858496 -Node: Arbitrary Precision Arithmetic859660 -Node: Computer Arithmetic860989 -Ref: Computer Arithmetic-Footnote-1865376 -Node: Math Definitions865433 -Ref: table-ieee-formats868317 -Node: MPFR features868821 -Node: FP Math Caution870463 -Ref: FP Math Caution-Footnote-1871504 -Node: Inexactness of computations871873 -Node: Inexact representation872821 -Node: Comparing FP Values874176 -Node: Errors accumulate875140 -Node: Getting Accuracy876573 -Node: Try To Round879232 -Node: Setting precision880131 -Ref: table-predefined-precision-strings880813 -Node: Setting the rounding mode882606 -Ref: table-gawk-rounding-modes882970 -Ref: Setting the rounding mode-Footnote-1886424 -Node: Arbitrary Precision Integers886603 -Ref: Arbitrary Precision Integers-Footnote-1889573 -Node: POSIX Floating Point Problems889722 -Ref: POSIX Floating Point Problems-Footnote-1893591 -Node: Floating point summary893629 -Node: Dynamic Extensions895846 -Node: Extension Intro897398 -Node: Plugin License898663 -Node: Extension Mechanism Outline899348 -Ref: figure-load-extension899772 -Ref: figure-load-new-function901257 -Ref: figure-call-new-function902259 -Node: Extension API Description904243 -Node: Extension API Functions Introduction905693 -Node: General Data Types910558 -Ref: General Data Types-Footnote-1916251 -Node: Requesting Values916550 -Ref: table-value-types-returned917287 -Node: Memory Allocation Functions918245 -Ref: Memory Allocation Functions-Footnote-1920992 -Node: Constructor Functions921088 -Node: Registration Functions922846 -Node: Extension Functions923531 -Node: Exit Callback Functions925833 -Node: Extension Version String927082 -Node: Input Parsers927732 -Node: Output Wrappers937535 -Node: Two-way processors942051 -Node: Printing Messages944255 -Ref: Printing Messages-Footnote-1945332 -Node: Updating `ERRNO'945484 -Node: Accessing Parameters946223 -Node: Symbol Table Access947453 -Node: Symbol table by name947967 -Node: Symbol table by cookie949943 -Ref: Symbol table by cookie-Footnote-1954076 -Node: Cached values954139 -Ref: Cached values-Footnote-1957643 -Node: Array Manipulation957734 -Ref: Array Manipulation-Footnote-1958832 -Node: Array Data Types958871 -Ref: Array Data Types-Footnote-1961574 -Node: Array Functions961666 -Node: Flattening Arrays965540 -Node: Creating Arrays972392 -Node: Extension API Variables977123 -Node: Extension Versioning977759 -Node: Extension API Informational Variables979660 -Node: Extension API Boilerplate980746 -Node: Finding Extensions984550 -Node: Extension Example985110 -Node: Internal File Description985840 -Node: Internal File Ops989931 -Ref: Internal File Ops-Footnote-11001363 -Node: Using Internal File Ops1001503 -Ref: Using Internal File Ops-Footnote-11003850 -Node: Extension Samples1004118 -Node: Extension Sample File Functions1005642 -Node: Extension Sample Fnmatch1013210 -Node: Extension Sample Fork1014691 -Node: Extension Sample Inplace1015904 -Node: Extension Sample Ord1017579 -Node: Extension Sample Readdir1018415 -Ref: table-readdir-file-types1019271 -Node: Extension Sample Revout1020070 -Node: Extension Sample Rev2way1020661 -Node: Extension Sample Read write array1021402 -Node: Extension Sample Readfile1023281 -Node: Extension Sample API Tests1024381 -Node: Extension Sample Time1024906 -Node: gawkextlib1026221 -Node: Extension summary1029034 -Node: Extension Exercises1032727 -Node: Language History1033449 -Node: V7/SVR3.11035092 -Node: SVR41037412 -Node: POSIX1038854 -Node: BTL1040240 -Node: POSIX/GNU1040974 -Node: Feature History1046573 -Node: Common Extensions1059703 -Node: Ranges and Locales1061015 -Ref: Ranges and Locales-Footnote-11065632 -Ref: Ranges and Locales-Footnote-21065659 -Ref: Ranges and Locales-Footnote-31065893 -Node: Contributors1066114 -Node: History summary1071576 -Node: Installation1072945 -Node: Gawk Distribution1073896 -Node: Getting1074380 -Node: Extracting1075204 -Node: Distribution contents1076846 -Node: Unix Installation1082563 -Node: Quick Installation1083180 -Node: Additional Configuration Options1085622 -Node: Configuration Philosophy1087360 -Node: Non-Unix Installation1089711 -Node: PC Installation1090169 -Node: PC Binary Installation1091480 -Node: PC Compiling1093328 -Ref: PC Compiling-Footnote-11096327 -Node: PC Testing1096432 -Node: PC Using1097608 -Node: Cygwin1101766 -Node: MSYS1102575 -Node: VMS Installation1103089 -Node: VMS Compilation1103885 -Ref: VMS Compilation-Footnote-11105107 -Node: VMS Dynamic Extensions1105165 -Node: VMS Installation Details1106538 -Node: VMS Running1108790 -Node: VMS GNV1111624 -Node: VMS Old Gawk1112347 -Node: Bugs1112817 -Node: Other Versions1116821 -Node: Installation summary1123076 -Node: Notes1124132 -Node: Compatibility Mode1124997 -Node: Additions1125779 -Node: Accessing The Source1126704 -Node: Adding Code1128140 -Node: New Ports1134318 -Node: Derived Files1138799 -Ref: Derived Files-Footnote-11143880 -Ref: Derived Files-Footnote-21143914 -Ref: Derived Files-Footnote-31144510 -Node: Future Extensions1144624 -Node: Implementation Limitations1145230 -Node: Extension Design1146478 -Node: Old Extension Problems1147632 -Ref: Old Extension Problems-Footnote-11149149 -Node: Extension New Mechanism Goals1149206 -Ref: Extension New Mechanism Goals-Footnote-11152566 -Node: Extension Other Design Decisions1152755 -Node: Extension Future Growth1154861 -Node: Old Extension Mechanism1155697 -Node: Notes summary1157459 -Node: Basic Concepts1158645 -Node: Basic High Level1159326 -Ref: figure-general-flow1159598 -Ref: figure-process-flow1160197 -Ref: Basic High Level-Footnote-11163426 -Node: Basic Data Typing1163611 -Node: Glossary1166939 -Node: Copying1192091 -Node: GNU Free Documentation License1229647 -Node: Index1254783 +Node: Foreword42034 +Node: Preface46379 +Ref: Preface-Footnote-149526 +Ref: Preface-Footnote-249633 +Node: History49865 +Node: Names52239 +Ref: Names-Footnote-153703 +Node: This Manual53776 +Ref: This Manual-Footnote-159555 +Node: Conventions59655 +Node: Manual History61811 +Ref: Manual History-Footnote-165250 +Ref: Manual History-Footnote-265291 +Node: How To Contribute65365 +Node: Acknowledgments66604 +Node: Getting Started70753 +Node: Running gawk73187 +Node: One-shot74377 +Node: Read Terminal75602 +Ref: Read Terminal-Footnote-177252 +Ref: Read Terminal-Footnote-277528 +Node: Long77699 +Node: Executable Scripts79075 +Ref: Executable Scripts-Footnote-180908 +Ref: Executable Scripts-Footnote-281010 +Node: Comments81557 +Node: Quoting84030 +Node: DOS Quoting89346 +Node: Sample Data Files90021 +Node: Very Simple92536 +Node: Two Rules97174 +Node: More Complex99068 +Ref: More Complex-Footnote-1102000 +Node: Statements/Lines102085 +Ref: Statements/Lines-Footnote-1106540 +Node: Other Features106805 +Node: When107733 +Node: Intro Summary109903 +Node: Invoking Gawk110669 +Node: Command Line112184 +Node: Options112975 +Ref: Options-Footnote-1128804 +Node: Other Arguments128829 +Node: Naming Standard Input131491 +Node: Environment Variables132585 +Node: AWKPATH Variable133143 +Ref: AWKPATH Variable-Footnote-1136015 +Ref: AWKPATH Variable-Footnote-2136060 +Node: AWKLIBPATH Variable136320 +Node: Other Environment Variables137079 +Node: Exit Status140734 +Node: Include Files141409 +Node: Loading Shared Libraries144987 +Node: Obsolete146371 +Node: Undocumented147068 +Node: Invoking Summary147335 +Node: Regexp148915 +Node: Regexp Usage150365 +Node: Escape Sequences152398 +Node: Regexp Operators158065 +Ref: Regexp Operators-Footnote-1165545 +Ref: Regexp Operators-Footnote-2165692 +Node: Bracket Expressions165790 +Ref: table-char-classes167680 +Node: GNU Regexp Operators170203 +Node: Case-sensitivity173926 +Ref: Case-sensitivity-Footnote-1176818 +Ref: Case-sensitivity-Footnote-2177053 +Node: Leftmost Longest177161 +Node: Computed Regexps178362 +Node: Regexp Summary181734 +Node: Reading Files183205 +Node: Records185297 +Node: awk split records186040 +Node: gawk split records190898 +Ref: gawk split records-Footnote-1195419 +Node: Fields195456 +Ref: Fields-Footnote-1198420 +Node: Nonconstant Fields198506 +Ref: Nonconstant Fields-Footnote-1200736 +Node: Changing Fields200938 +Node: Field Separators206892 +Node: Default Field Splitting209594 +Node: Regexp Field Splitting210711 +Node: Single Character Fields214052 +Node: Command Line Field Separator215111 +Node: Full Line Fields218453 +Ref: Full Line Fields-Footnote-1218961 +Node: Field Splitting Summary219007 +Ref: Field Splitting Summary-Footnote-1222106 +Node: Constant Size222207 +Node: Splitting By Content226814 +Ref: Splitting By Content-Footnote-1230564 +Node: Multiple Line230604 +Ref: Multiple Line-Footnote-1236460 +Node: Getline236639 +Node: Plain Getline238855 +Node: Getline/Variable240950 +Node: Getline/File242097 +Node: Getline/Variable/File243481 +Ref: Getline/Variable/File-Footnote-1245080 +Node: Getline/Pipe245167 +Node: Getline/Variable/Pipe247866 +Node: Getline/Coprocess248973 +Node: Getline/Variable/Coprocess250225 +Node: Getline Notes250962 +Node: Getline Summary253766 +Ref: table-getline-variants254174 +Node: Read Timeout255086 +Ref: Read Timeout-Footnote-1258913 +Node: Command line directories258971 +Node: Input Summary259875 +Node: Input Exercises263012 +Node: Printing263745 +Node: Print265467 +Node: Print Examples266808 +Node: Output Separators269587 +Node: OFMT271603 +Node: Printf272961 +Node: Basic Printf273867 +Node: Control Letters275406 +Node: Format Modifiers279258 +Node: Printf Examples285285 +Node: Redirection287749 +Node: Special Files294721 +Node: Special FD295252 +Ref: Special FD-Footnote-1298876 +Node: Special Network298950 +Node: Special Caveats299800 +Node: Close Files And Pipes300596 +Ref: Close Files And Pipes-Footnote-1307757 +Ref: Close Files And Pipes-Footnote-2307905 +Node: Output Summary308055 +Node: Output exercises309052 +Node: Expressions309732 +Node: Values310917 +Node: Constants311593 +Node: Scalar Constants312273 +Ref: Scalar Constants-Footnote-1313132 +Node: Nondecimal-numbers313382 +Node: Regexp Constants316382 +Node: Using Constant Regexps316857 +Node: Variables319927 +Node: Using Variables320582 +Node: Assignment Options322306 +Node: Conversion324181 +Node: Strings And Numbers324705 +Ref: Strings And Numbers-Footnote-1327767 +Node: Locale influences conversions327876 +Ref: table-locale-affects330593 +Node: All Operators331181 +Node: Arithmetic Ops331811 +Node: Concatenation334316 +Ref: Concatenation-Footnote-1337112 +Node: Assignment Ops337232 +Ref: table-assign-ops342215 +Node: Increment Ops343532 +Node: Truth Values and Conditions346970 +Node: Truth Values348053 +Node: Typing and Comparison349102 +Node: Variable Typing349895 +Ref: Variable Typing-Footnote-1353795 +Node: Comparison Operators353917 +Ref: table-relational-ops354327 +Node: POSIX String Comparison357877 +Ref: POSIX String Comparison-Footnote-1358961 +Node: Boolean Ops359099 +Ref: Boolean Ops-Footnote-1363169 +Node: Conditional Exp363260 +Node: Function Calls364987 +Node: Precedence368745 +Node: Locales372414 +Node: Expressions Summary374045 +Node: Patterns and Actions376586 +Node: Pattern Overview377702 +Node: Regexp Patterns379379 +Node: Expression Patterns379922 +Node: Ranges383703 +Node: BEGIN/END386809 +Node: Using BEGIN/END387571 +Ref: Using BEGIN/END-Footnote-1390307 +Node: I/O And BEGIN/END390413 +Node: BEGINFILE/ENDFILE392698 +Node: Empty395629 +Node: Using Shell Variables395946 +Node: Action Overview398229 +Node: Statements400556 +Node: If Statement402404 +Node: While Statement403902 +Node: Do Statement405946 +Node: For Statement407102 +Node: Switch Statement410254 +Node: Break Statement412357 +Node: Continue Statement414412 +Node: Next Statement416205 +Node: Nextfile Statement418595 +Node: Exit Statement421250 +Node: Built-in Variables423654 +Node: User-modified424781 +Ref: User-modified-Footnote-1432470 +Node: Auto-set432532 +Ref: Auto-set-Footnote-1445114 +Ref: Auto-set-Footnote-2445319 +Node: ARGC and ARGV445375 +Node: Pattern Action Summary449229 +Node: Arrays451452 +Node: Array Basics453001 +Node: Array Intro453827 +Ref: figure-array-elements455800 +Node: Reference to Elements458207 +Node: Assigning Elements460480 +Node: Array Example460971 +Node: Scanning an Array462703 +Node: Controlling Scanning465718 +Ref: Controlling Scanning-Footnote-1470891 +Node: Delete471207 +Ref: Delete-Footnote-1473972 +Node: Numeric Array Subscripts474029 +Node: Uninitialized Subscripts476212 +Node: Multidimensional477837 +Node: Multiscanning480930 +Node: Arrays of Arrays482519 +Node: Arrays Summary487182 +Node: Functions489287 +Node: Built-in490160 +Node: Calling Built-in491238 +Node: Numeric Functions493226 +Ref: Numeric Functions-Footnote-1497060 +Ref: Numeric Functions-Footnote-2497417 +Ref: Numeric Functions-Footnote-3497465 +Node: String Functions497734 +Ref: String Functions-Footnote-1520745 +Ref: String Functions-Footnote-2520874 +Ref: String Functions-Footnote-3521122 +Node: Gory Details521209 +Ref: table-sub-escapes522878 +Ref: table-sub-posix-92524232 +Ref: table-sub-proposed525583 +Ref: table-posix-sub526937 +Ref: table-gensub-escapes528482 +Ref: Gory Details-Footnote-1529658 +Ref: Gory Details-Footnote-2529709 +Node: I/O Functions529860 +Ref: I/O Functions-Footnote-1536983 +Node: Time Functions537130 +Ref: Time Functions-Footnote-1547594 +Ref: Time Functions-Footnote-2547662 +Ref: Time Functions-Footnote-3547820 +Ref: Time Functions-Footnote-4547931 +Ref: Time Functions-Footnote-5548043 +Ref: Time Functions-Footnote-6548270 +Node: Bitwise Functions548536 +Ref: table-bitwise-ops549098 +Ref: Bitwise Functions-Footnote-1553343 +Node: Type Functions553527 +Node: I18N Functions554669 +Node: User-defined556314 +Node: Definition Syntax557118 +Ref: Definition Syntax-Footnote-1562043 +Node: Function Example562112 +Ref: Function Example-Footnote-1564756 +Node: Function Caveats564778 +Node: Calling A Function565296 +Node: Variable Scope566251 +Node: Pass By Value/Reference569239 +Node: Return Statement572747 +Node: Dynamic Typing575731 +Node: Indirect Calls576660 +Node: Functions Summary586373 +Node: Library Functions588912 +Ref: Library Functions-Footnote-1592530 +Ref: Library Functions-Footnote-2592673 +Node: Library Names592844 +Ref: Library Names-Footnote-1596317 +Ref: Library Names-Footnote-2596537 +Node: General Functions596623 +Node: Strtonum Function597651 +Node: Assert Function600431 +Node: Round Function603757 +Node: Cliff Random Function605298 +Node: Ordinal Functions606314 +Ref: Ordinal Functions-Footnote-1609391 +Ref: Ordinal Functions-Footnote-2609643 +Node: Join Function609854 +Ref: Join Function-Footnote-1611625 +Node: Getlocaltime Function611825 +Node: Readfile Function615561 +Node: Data File Management617400 +Node: Filetrans Function618032 +Node: Rewind Function622101 +Node: File Checking623488 +Ref: File Checking-Footnote-1624620 +Node: Empty Files624821 +Node: Ignoring Assigns626800 +Node: Getopt Function628354 +Ref: Getopt Function-Footnote-1639657 +Node: Passwd Functions639860 +Ref: Passwd Functions-Footnote-1648839 +Node: Group Functions648927 +Ref: Group Functions-Footnote-1656868 +Node: Walking Arrays657081 +Node: Library Functions Summary658684 +Node: Library exercises660072 +Node: Sample Programs661352 +Node: Running Examples662122 +Node: Clones662850 +Node: Cut Program664074 +Node: Egrep Program673942 +Ref: Egrep Program-Footnote-1681913 +Node: Id Program682023 +Node: Split Program685687 +Ref: Split Program-Footnote-1689225 +Node: Tee Program689353 +Node: Uniq Program692160 +Node: Wc Program699590 +Ref: Wc Program-Footnote-1703855 +Node: Miscellaneous Programs703947 +Node: Dupword Program705160 +Node: Alarm Program707191 +Node: Translate Program712005 +Ref: Translate Program-Footnote-1716396 +Ref: Translate Program-Footnote-2716666 +Node: Labels Program716800 +Ref: Labels Program-Footnote-1720171 +Node: Word Sorting720255 +Node: History Sorting724298 +Node: Extract Program726134 +Node: Simple Sed733670 +Node: Igawk Program736732 +Ref: Igawk Program-Footnote-1751043 +Ref: Igawk Program-Footnote-2751244 +Node: Anagram Program751382 +Node: Signature Program754450 +Node: Programs Summary755697 +Node: Programs Exercises756912 +Node: Advanced Features760563 +Node: Nondecimal Data762511 +Node: Array Sorting764088 +Node: Controlling Array Traversal764785 +Node: Array Sorting Functions773065 +Ref: Array Sorting Functions-Footnote-1776972 +Node: Two-way I/O777166 +Ref: Two-way I/O-Footnote-1782682 +Node: TCP/IP Networking782764 +Node: Profiling785608 +Node: Advanced Features Summary793150 +Node: Internationalization795014 +Node: I18N and L10N796494 +Node: Explaining gettext797180 +Ref: Explaining gettext-Footnote-1802320 +Ref: Explaining gettext-Footnote-2802504 +Node: Programmer i18n802669 +Node: Translator i18n806894 +Node: String Extraction807688 +Ref: String Extraction-Footnote-1808649 +Node: Printf Ordering808735 +Ref: Printf Ordering-Footnote-1811517 +Node: I18N Portability811581 +Ref: I18N Portability-Footnote-1814030 +Node: I18N Example814093 +Ref: I18N Example-Footnote-1816815 +Node: Gawk I18N816887 +Node: I18N Summary817525 +Node: Debugger818864 +Node: Debugging819886 +Node: Debugging Concepts820327 +Node: Debugging Terms822183 +Node: Awk Debugging824780 +Node: Sample Debugging Session825672 +Node: Debugger Invocation826192 +Node: Finding The Bug827525 +Node: List of Debugger Commands834007 +Node: Breakpoint Control835339 +Node: Debugger Execution Control839003 +Node: Viewing And Changing Data842363 +Node: Execution Stack845721 +Node: Debugger Info847234 +Node: Miscellaneous Debugger Commands851228 +Node: Readline Support856412 +Node: Limitations857304 +Node: Debugging Summary859578 +Node: Arbitrary Precision Arithmetic860742 +Node: Computer Arithmetic862071 +Ref: Computer Arithmetic-Footnote-1866458 +Node: Math Definitions866515 +Ref: table-ieee-formats869399 +Node: MPFR features869903 +Node: FP Math Caution871545 +Ref: FP Math Caution-Footnote-1872586 +Node: Inexactness of computations872955 +Node: Inexact representation873903 +Node: Comparing FP Values875258 +Node: Errors accumulate876222 +Node: Getting Accuracy877655 +Node: Try To Round880314 +Node: Setting precision881213 +Ref: table-predefined-precision-strings881895 +Node: Setting the rounding mode883688 +Ref: table-gawk-rounding-modes884052 +Ref: Setting the rounding mode-Footnote-1887506 +Node: Arbitrary Precision Integers887685 +Ref: Arbitrary Precision Integers-Footnote-1890688 +Node: POSIX Floating Point Problems890837 +Ref: POSIX Floating Point Problems-Footnote-1894713 +Node: Floating point summary894751 +Node: Dynamic Extensions896968 +Node: Extension Intro898520 +Node: Plugin License899785 +Node: Extension Mechanism Outline900470 +Ref: figure-load-extension900894 +Ref: figure-load-new-function902379 +Ref: figure-call-new-function903381 +Node: Extension API Description905365 +Node: Extension API Functions Introduction906815 +Node: General Data Types911680 +Ref: General Data Types-Footnote-1917373 +Node: Requesting Values917672 +Ref: table-value-types-returned918409 +Node: Memory Allocation Functions919367 +Ref: Memory Allocation Functions-Footnote-1922114 +Node: Constructor Functions922210 +Node: Registration Functions923968 +Node: Extension Functions924653 +Node: Exit Callback Functions926955 +Node: Extension Version String928204 +Node: Input Parsers928854 +Node: Output Wrappers938657 +Node: Two-way processors943173 +Node: Printing Messages945377 +Ref: Printing Messages-Footnote-1946454 +Node: Updating `ERRNO'946606 +Node: Accessing Parameters947345 +Node: Symbol Table Access948575 +Node: Symbol table by name949089 +Node: Symbol table by cookie951065 +Ref: Symbol table by cookie-Footnote-1955198 +Node: Cached values955261 +Ref: Cached values-Footnote-1958765 +Node: Array Manipulation958856 +Ref: Array Manipulation-Footnote-1959954 +Node: Array Data Types959993 +Ref: Array Data Types-Footnote-1962696 +Node: Array Functions962788 +Node: Flattening Arrays966662 +Node: Creating Arrays973514 +Node: Extension API Variables978245 +Node: Extension Versioning978881 +Node: Extension API Informational Variables980782 +Node: Extension API Boilerplate981868 +Node: Finding Extensions985672 +Node: Extension Example986232 +Node: Internal File Description986962 +Node: Internal File Ops991053 +Ref: Internal File Ops-Footnote-11002485 +Node: Using Internal File Ops1002625 +Ref: Using Internal File Ops-Footnote-11004972 +Node: Extension Samples1005240 +Node: Extension Sample File Functions1006764 +Node: Extension Sample Fnmatch1014332 +Node: Extension Sample Fork1015813 +Node: Extension Sample Inplace1017026 +Node: Extension Sample Ord1018701 +Node: Extension Sample Readdir1019537 +Ref: table-readdir-file-types1020393 +Node: Extension Sample Revout1021192 +Node: Extension Sample Rev2way1021783 +Node: Extension Sample Read write array1022524 +Node: Extension Sample Readfile1024403 +Node: Extension Sample API Tests1025503 +Node: Extension Sample Time1026028 +Node: gawkextlib1027343 +Node: Extension summary1030156 +Node: Extension Exercises1033849 +Node: Language History1034571 +Node: V7/SVR3.11036214 +Node: SVR41038534 +Node: POSIX1039976 +Node: BTL1041362 +Node: POSIX/GNU1042096 +Node: Feature History1047695 +Node: Common Extensions1060825 +Node: Ranges and Locales1062137 +Ref: Ranges and Locales-Footnote-11066754 +Ref: Ranges and Locales-Footnote-21066781 +Ref: Ranges and Locales-Footnote-31067015 +Node: Contributors1067236 +Node: History summary1072698 +Node: Installation1074067 +Node: Gawk Distribution1075018 +Node: Getting1075502 +Node: Extracting1076326 +Node: Distribution contents1077968 +Node: Unix Installation1083685 +Node: Quick Installation1084302 +Node: Additional Configuration Options1086744 +Node: Configuration Philosophy1088482 +Node: Non-Unix Installation1090833 +Node: PC Installation1091291 +Node: PC Binary Installation1092602 +Node: PC Compiling1094450 +Ref: PC Compiling-Footnote-11097449 +Node: PC Testing1097554 +Node: PC Using1098730 +Node: Cygwin1102888 +Node: MSYS1103697 +Node: VMS Installation1104211 +Node: VMS Compilation1105007 +Ref: VMS Compilation-Footnote-11106229 +Node: VMS Dynamic Extensions1106287 +Node: VMS Installation Details1107660 +Node: VMS Running1109912 +Node: VMS GNV1112746 +Node: VMS Old Gawk1113469 +Node: Bugs1113939 +Node: Other Versions1117943 +Node: Installation summary1124198 +Node: Notes1125254 +Node: Compatibility Mode1126119 +Node: Additions1126901 +Node: Accessing The Source1127826 +Node: Adding Code1129262 +Node: New Ports1135440 +Node: Derived Files1139921 +Ref: Derived Files-Footnote-11145002 +Ref: Derived Files-Footnote-21145036 +Ref: Derived Files-Footnote-31145632 +Node: Future Extensions1145746 +Node: Implementation Limitations1146352 +Node: Extension Design1147600 +Node: Old Extension Problems1148754 +Ref: Old Extension Problems-Footnote-11150271 +Node: Extension New Mechanism Goals1150328 +Ref: Extension New Mechanism Goals-Footnote-11153688 +Node: Extension Other Design Decisions1153877 +Node: Extension Future Growth1155983 +Node: Old Extension Mechanism1156819 +Node: Notes summary1158581 +Node: Basic Concepts1159767 +Node: Basic High Level1160448 +Ref: figure-general-flow1160720 +Ref: figure-process-flow1161319 +Ref: Basic High Level-Footnote-11164548 +Node: Basic Data Typing1164733 +Node: Glossary1168061 +Node: Copying1193213 +Node: GNU Free Documentation License1230769 +Node: Index1255905 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 3d910ee0..b210da10 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -611,6 +611,9 @@ particular records in a file and perform operations upon them. This is an advanced method of input. * Conversion:: The conversion of strings to numbers and vice versa. +* Strings And Numbers:: How @command{awk} Converts Between + Strings And Numbers. +* Locale influences conversions:: How the locale may affect conversions. * All Operators:: @command{gawk}'s operators. * Arithmetic Ops:: Arithmetic operations (@samp{+}, @samp{-}, etc.) @@ -10663,6 +10666,19 @@ sequences @node Conversion @subsection Conversion of Strings and Numbers +Number to string and string to number conversion are generally +straightforward. There can be subtleties to be aware of; +this @value{SECTION} discusses this important facet of @command{awk}. + +@menu +* Strings And Numbers:: How @command{awk} Converts Between Strings And + Numbers. +* Locale influences conversions:: How the locale may affect conversions. +@end menu + +@node Strings And Numbers +@subsubsection How @command{awk} Converts Between Strings And Numbers + @cindex converting, strings to numbers @cindex strings, converting @cindex numbers, converting @@ -10732,6 +10748,35 @@ b = a "" @code{b} has the value @code{"12"}, not @code{"12.00"}. @value{DARKCORNER} +@cindex sidebar, Pre-POSIX @command{awk} Used @code{OFMT} For String Conversion +@ifdocbook +@docbook +<sidebar><title>Pre-POSIX @command{awk} Used @code{OFMT} For String Conversion</title> +@end docbook + +@cindex POSIX @command{awk}, @code{OFMT} variable and +@cindex @code{OFMT} variable +@cindex portability, new @command{awk} vs.@: old @command{awk} +@cindex @command{awk}, new vs.@: old, @code{OFMT} variable +Prior to the POSIX standard, @command{awk} used the value +of @code{OFMT} for converting numbers to strings. @code{OFMT} +specifies the output format to use when printing numbers with @code{print}. +@code{CONVFMT} was introduced in order to separate the semantics of +conversion from the semantics of printing. Both @code{CONVFMT} and +@code{OFMT} have the same default value: @code{"%.6g"}. In the vast majority +of cases, old @command{awk} programs do not change their behavior. +@xref{Print}, for more information on the @code{print} statement. + +@docbook +</sidebar> +@end docbook +@end ifdocbook + +@ifnotdocbook +@cartouche +@center @b{Pre-POSIX @command{awk} Used @code{OFMT} For String Conversion} + + @cindex POSIX @command{awk}, @code{OFMT} variable and @cindex @code{OFMT} variable @cindex portability, new @command{awk} vs.@: old @command{awk} @@ -10744,6 +10789,11 @@ conversion from the semantics of printing. Both @code{CONVFMT} and @code{OFMT} have the same default value: @code{"%.6g"}. In the vast majority of cases, old @command{awk} programs do not change their behavior. @xref{Print}, for more information on the @code{print} statement. +@end cartouche +@end ifnotdocbook + +@node Locale influences conversions +@subsubsection Locales Can Influence Conversion Where you are can matter when it comes to converting between numbers and strings. The local character set and language---the @dfn{locale}---can @@ -12632,6 +12682,7 @@ of others let you control how @command{awk} behaves. Numbers are automatically converted to strings, and strings to numbers, as needed by @command{awk}. Numeric values are converted as if they were formatted with @code{sprintf()} using the format in @code{CONVFMT}. +Locales can influence the conversions. @item @command{awk} provides the usual arithmetic operators (addition, @@ -30354,7 +30405,7 @@ the following computes 5<superscript>4<superscript>3<superscript>2</superscript></superscript></superscript>, @c @end docbook the result of which is beyond the -limits of ordinary @command{gawk} numbers: +limits of ordinary hardware double-precision floating point values: @example $ @kbd{gawk -M 'BEGIN @{} @@ -30462,7 +30513,7 @@ source code constants.) Support for the special IEEE 754 floating point values ``Not A Number'' (NaN), positive Infinity (``inf'') and negative Infinity (``@minus{}inf''). In particular, the format for these values is as specified by the ISO 1999 -C standard, which ignores case and can allow machine-dependent additional +C standard, which ignores case and can allow implementation-dependent additional characters after the @samp{nan} and allow either @samp{inf} or @samp{infinity}. @end itemize diff --git a/doc/gawktexi.in b/doc/gawktexi.in index eac398a9..fb7fa188 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -606,6 +606,9 @@ particular records in a file and perform operations upon them. This is an advanced method of input. * Conversion:: The conversion of strings to numbers and vice versa. +* Strings And Numbers:: How @command{awk} Converts Between + Strings And Numbers. +* Locale influences conversions:: How the locale may affect conversions. * All Operators:: @command{gawk}'s operators. * Arithmetic Ops:: Arithmetic operations (@samp{+}, @samp{-}, etc.) @@ -10153,6 +10156,19 @@ sequences @node Conversion @subsection Conversion of Strings and Numbers +Number to string and string to number conversion are generally +straightforward. There can be subtleties to be aware of; +this @value{SECTION} discusses this important facet of @command{awk}. + +@menu +* Strings And Numbers:: How @command{awk} Converts Between Strings And + Numbers. +* Locale influences conversions:: How the locale may affect conversions. +@end menu + +@node Strings And Numbers +@subsubsection How @command{awk} Converts Between Strings And Numbers + @cindex converting, strings to numbers @cindex strings, converting @cindex numbers, converting @@ -10222,6 +10238,7 @@ b = a "" @code{b} has the value @code{"12"}, not @code{"12.00"}. @value{DARKCORNER} +@sidebar Pre-POSIX @command{awk} Used @code{OFMT} For String Conversion @cindex POSIX @command{awk}, @code{OFMT} variable and @cindex @code{OFMT} variable @cindex portability, new @command{awk} vs.@: old @command{awk} @@ -10234,6 +10251,10 @@ conversion from the semantics of printing. Both @code{CONVFMT} and @code{OFMT} have the same default value: @code{"%.6g"}. In the vast majority of cases, old @command{awk} programs do not change their behavior. @xref{Print}, for more information on the @code{print} statement. +@end sidebar + +@node Locale influences conversions +@subsubsection Locales Can Influence Conversion Where you are can matter when it comes to converting between numbers and strings. The local character set and language---the @dfn{locale}---can @@ -12012,6 +12033,7 @@ of others let you control how @command{awk} behaves. Numbers are automatically converted to strings, and strings to numbers, as needed by @command{awk}. Numeric values are converted as if they were formatted with @code{sprintf()} using the format in @code{CONVFMT}. +Locales can influence the conversions. @item @command{awk} provides the usual arithmetic operators (addition, @@ -29498,7 +29520,7 @@ the following computes 5<superscript>4<superscript>3<superscript>2</superscript></superscript></superscript>, @c @end docbook the result of which is beyond the -limits of ordinary @command{gawk} numbers: +limits of ordinary hardware double-precision floating point values: @example $ @kbd{gawk -M 'BEGIN @{} @@ -29606,7 +29628,7 @@ source code constants.) Support for the special IEEE 754 floating point values ``Not A Number'' (NaN), positive Infinity (``inf'') and negative Infinity (``@minus{}inf''). In particular, the format for these values is as specified by the ISO 1999 -C standard, which ignores case and can allow machine-dependent additional +C standard, which ignores case and can allow implementation-dependent additional characters after the @samp{nan} and allow either @samp{inf} or @samp{infinity}. @end itemize |