diff options
Diffstat (limited to 'doc/gawk.info')
-rw-r--r-- | doc/gawk.info | 1231 |
1 files changed, 667 insertions, 564 deletions
diff --git a/doc/gawk.info b/doc/gawk.info index 102bc769..99f29492 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -175,6 +175,7 @@ in (a) below. A copy of the license is included in the section entitled * Computed Regexps:: Using Dynamic Regexps. * GNU Regexp Operators:: Operators specific to GNU software. * Case-sensitivity:: How to do case-insensitive matching. +* Strong Regexp Constants:: Strongly typed regexp constants. * Regexp Summary:: Regular expressions summary. * Records:: Controlling how data is split into records. @@ -3311,6 +3312,7 @@ you specify more complicated classes of strings. * Computed Regexps:: Using Dynamic Regexps. * GNU Regexp Operators:: Operators specific to GNU software. * Case-sensitivity:: How to do case-insensitive matching. +* Strong Regexp Constants:: Strongly typed regexp constants. * Regexp Summary:: Regular expressions summary. @@ -4013,7 +4015,7 @@ No options default. -File: gawk.info, Node: Case-sensitivity, Next: Regexp Summary, Prev: GNU Regexp Operators, Up: Regexp +File: gawk.info, Node: Case-sensitivity, Next: Strong Regexp Constants, Prev: GNU Regexp Operators, Up: Regexp 3.8 Case Sensitivity in Matching ================================ @@ -4087,10 +4089,77 @@ and we don't recommend it. that 'gawk' does the right thing. -File: gawk.info, Node: Regexp Summary, Prev: Case-sensitivity, Up: Regexp +File: gawk.info, Node: Strong Regexp Constants, Next: Regexp Summary, Prev: Case-sensitivity, Up: Regexp -3.9 Summary -=========== +3.9 Strongly Typed Regexp Constants +=================================== + +This minor node describes a 'gawk'-specific feature. + + Regexp constants ('/.../') hold a strange position in the 'awk' +language. In most contexts, they act like an expression: '$0 ~ /.../'. +In other contexts, they denote only a regexp to be matched. In no case +are they really a "first class citizen" of the language. That is, you +cannot define a scalar variable whose type is "regexp" in the same sense +that you can define a variable to be a number or a string: + + num = 42 Numeric variable + str = "hi" String variable + re = /foo/ Wrong! re is the result of $0 ~ /foo/ + + For a number of more advanced use cases (described later on in this +Info file), it would be nice to have regexp constants that are "strongly +typed"; in other words, that denote a regexp useful for matching, and +not an expression. + + 'gawk' provides this feature. A strongly typed regexp constant looks +almost like a regular regexp constant, except that it is preceded by an +'@' sign: + + re = @/foo/ Regexp variable + + Strongly typed regexp constants _cannot_ be used eveywhere that a +regular regexp constant can, because this would make the language even +more confusing. Instead, you may use them only in certain contexts: + + * On the righthand side of the '~' and '!~' operators: 'some_var ~ + @/foo/' (*note Regexp Usage::). + + * In the 'case' part of a 'switch' statement (*note Switch + Statement::). + + * As an argument to one of the built-in functions that accept regexp + constants: 'gensub()', 'gsub()', 'match()', 'patsplit()', + 'split()', and 'sub()' (*note String Functions::). + + * As a parameter in a call to a user-defined function (*note + User-defined::). + + * On the righthand side of an assignment to a variable: 'some_var = + @/foo/'. In this case, the type of 'some_var' is regexp. + Additionally, 'some_var' can be used with '~' and '!~', passed to + one of the built-in functions listed above, or passed as a + parameter to a user-defined function. + + You may use the 'typeof()' built-in function (*note Type Functions::) +to determine if a variable or function parameter is a regexp variable. + + The true power of this feature comes from the ability to create +variables that have regexp type. Such variables can be passed on to +user-defined functions, without the confusing aspects of computed +regular expressions created from strings or string constants. They may +also be passed through indirect function calls (*note Indirect Calls::) +onto the built-in functions that accept regexp constants. + + When used in numeric conversions, strongly typed regexp variables +convert to zero. When used in string conversions, they convert to the +string value of the original regexp text. + + +File: gawk.info, Node: Regexp Summary, Prev: Strong Regexp Constants, Up: Regexp + +3.10 Summary +============ * Regular expressions describe sets of strings to be matched. In 'awk', regular expression constants are written enclosed between @@ -4123,6 +4192,9 @@ File: gawk.info, Node: Regexp Summary, Prev: Case-sensitivity, Up: Regexp sensitivity of regexp matching. In other 'awk' versions, use 'tolower()' or 'toupper()'. + * Strongly typed regexp constants ('@/.../') enable certain advanced + use cases to be described later on in the Info file. + File: gawk.info, Node: Reading Files, Next: Printing, Prev: Regexp, Up: Top @@ -13426,14 +13498,33 @@ File: gawk.info, Node: Type Functions, Next: I18N Functions, Prev: Bitwise Fu 9.1.7 Getting Type Information ------------------------------ -'gawk' provides a single function that lets you distinguish an array -from a scalar variable. This is necessary for writing code that -traverses every element of an array of arrays (*note Arrays of -Arrays::). +'gawk' provides two functions that lets you distinguish the type of a +variable. This is necessary for writing code that traverses every +element of an array of arrays (*note Arrays of Arrays::), and in other +contexts. 'isarray(X)' Return a true value if X is an array. Otherwise, return false. +'typeof(X)' + Return one of the following strings, depending upon the type of X: + + '"array"' + X is an array. + + '"regexp"' + X is a strongly typed regexp (*note Strong Regexp + Constants::). + + '"scalar_n"' + X is a number. + + '"scalar_s"' + X is a string. + + '"untyped"' + X has not yet been given a type. + 'isarray()' is meant for use in two circumstances. The first is when traversing a multidimensional array: you can test if an element is itself an array or not. The second is inside the body of a user-defined @@ -13447,6 +13538,14 @@ parameter is an array or not. that has not been previously used to 'isarray()', 'gawk' ends up turning it into a scalar. + The 'typeof()' function is general; it allows you to determine if a +variable or function parameter is a scalar, an array, or a strongly +typed regexp. + + 'isarray()' is deprecated; you should use 'typeof()' instead. You +should replace any existing uses of 'isarray(var)' in your code with +'typeof(var) == "array"'. + File: gawk.info, Node: I18N Functions, Prev: Type Functions, Up: Built-in @@ -34731,6 +34830,8 @@ Index * trunc-mod operation: Arithmetic Ops. (line 66) * truth values: Truth Values. (line 6) * type conversion: Strings And Numbers. (line 21) +* type, of variable: Type Functions. (line 14) +* 'typeof': Type Functions. (line 14) * 'u' debugger command (alias for 'until'): Debugger Execution Control. (line 82) * unassigned array elements: Reference to Elements. @@ -34777,6 +34878,7 @@ Index * values, numeric: Basic Data Typing. (line 13) * values, string: Basic Data Typing. (line 13) * variable assignments and input files: Other Arguments. (line 26) +* variable type: Type Functions. (line 14) * variable typing: Typing and Comparison. (line 9) * variables: Other Features. (line 6) @@ -34877,561 +34979,562 @@ Index Tag Table: Node: Top1200 -Node: Foreword342435 -Node: Foreword446877 -Node: Preface48409 -Ref: Preface-Footnote-151281 -Ref: Preface-Footnote-251388 -Ref: Preface-Footnote-351622 -Node: History51764 -Node: Names54117 -Ref: Names-Footnote-155211 -Node: This Manual55358 -Ref: This Manual-Footnote-161840 -Node: Conventions61940 -Node: Manual History64295 -Ref: Manual History-Footnote-167291 -Ref: Manual History-Footnote-267332 -Node: How To Contribute67406 -Node: Acknowledgments68535 -Node: Getting Started73403 -Node: Running gawk75842 -Node: One-shot77032 -Node: Read Terminal78295 -Node: Long80327 -Node: Executable Scripts81840 -Ref: Executable Scripts-Footnote-184635 -Node: Comments84738 -Node: Quoting87222 -Node: DOS Quoting92740 -Node: Sample Data Files93415 -Node: Very Simple96010 -Node: Two Rules100912 -Node: More Complex102798 -Node: Statements/Lines105661 -Ref: Statements/Lines-Footnote-1110120 -Node: Other Features110385 -Node: When111322 -Ref: When-Footnote-1113076 -Node: Intro Summary113141 -Node: Invoking Gawk114025 -Node: Command Line115539 -Node: Options116337 -Ref: Options-Footnote-1131988 -Ref: Options-Footnote-2132218 -Node: Other Arguments132243 -Node: Naming Standard Input135190 -Node: Environment Variables136283 -Node: AWKPATH Variable136841 -Ref: AWKPATH Variable-Footnote-1140252 -Ref: AWKPATH Variable-Footnote-2140297 -Node: AWKLIBPATH Variable140558 -Node: Other Environment Variables141815 -Node: Exit Status145453 -Node: Include Files146130 -Node: Loading Shared Libraries149725 -Node: Obsolete151153 -Node: Undocumented151845 -Node: Invoking Summary152142 -Node: Regexp153802 -Node: Regexp Usage155256 -Node: Escape Sequences157293 -Node: Regexp Operators163526 -Ref: Regexp Operators-Footnote-1170943 -Ref: Regexp Operators-Footnote-2171090 -Node: Bracket Expressions171188 -Ref: table-char-classes173211 -Node: Leftmost Longest176157 -Node: Computed Regexps177460 -Node: GNU Regexp Operators180887 -Node: Case-sensitivity184566 -Ref: Case-sensitivity-Footnote-1187453 -Ref: Case-sensitivity-Footnote-2187688 -Node: Regexp Summary187796 -Node: Reading Files189262 -Node: Records191425 -Node: awk split records192158 -Node: gawk split records197090 -Ref: gawk split records-Footnote-1201634 -Node: Fields201671 -Node: Nonconstant Fields204412 -Ref: Nonconstant Fields-Footnote-1206648 -Node: Changing Fields206852 -Node: Field Separators212782 -Node: Default Field Splitting215480 -Node: Regexp Field Splitting216598 -Node: Single Character Fields219951 -Node: Command Line Field Separator221011 -Node: Full Line Fields224229 -Ref: Full Line Fields-Footnote-1225751 -Ref: Full Line Fields-Footnote-2225797 -Node: Field Splitting Summary225898 -Node: Constant Size227972 -Node: Splitting By Content232551 -Ref: Splitting By Content-Footnote-1236522 -Node: Multiple Line236685 -Ref: Multiple Line-Footnote-1242568 -Node: Getline242747 -Node: Plain Getline245214 -Node: Getline/Variable247853 -Node: Getline/File249002 -Node: Getline/Variable/File250388 -Ref: Getline/Variable/File-Footnote-1251992 -Node: Getline/Pipe252080 -Node: Getline/Variable/Pipe254785 -Node: Getline/Coprocess255918 -Node: Getline/Variable/Coprocess257183 -Node: Getline Notes257923 -Node: Getline Summary260718 -Ref: table-getline-variants261140 -Node: Read Timeout261888 -Ref: Read Timeout-Footnote-1265795 -Node: Retrying Input265853 -Node: Command-line directories267052 -Node: Input Summary267959 -Node: Input Exercises271131 -Node: Printing271859 -Node: Print273694 -Node: Print Examples275151 -Node: Output Separators277931 -Node: OFMT279948 -Node: Printf281304 -Node: Basic Printf282089 -Node: Control Letters283663 -Node: Format Modifiers287651 -Node: Printf Examples293666 -Node: Redirection296152 -Node: Special FD302995 -Ref: Special FD-Footnote-1306163 -Node: Special Files306237 -Node: Other Inherited Files306854 -Node: Special Network307855 -Node: Special Caveats308715 -Node: Close Files And Pipes309664 -Ref: Close Files And Pipes-Footnote-1316851 -Ref: Close Files And Pipes-Footnote-2316999 -Node: Nonfatal317150 -Node: Output Summary319475 -Node: Output Exercises320697 -Node: Expressions321376 -Node: Values322564 -Node: Constants323242 -Node: Scalar Constants323933 -Ref: Scalar Constants-Footnote-1324797 -Node: Nondecimal-numbers325047 -Node: Regexp Constants328061 -Node: Using Constant Regexps328587 -Node: Variables331750 -Node: Using Variables332407 -Node: Assignment Options334318 -Node: Conversion336192 -Node: Strings And Numbers336716 -Ref: Strings And Numbers-Footnote-1339780 -Node: Locale influences conversions339889 -Ref: table-locale-affects342647 -Node: All Operators343265 -Node: Arithmetic Ops343894 -Node: Concatenation346400 -Ref: Concatenation-Footnote-1349247 -Node: Assignment Ops349354 -Ref: table-assign-ops354346 -Node: Increment Ops355659 -Node: Truth Values and Conditions359119 -Node: Truth Values360193 -Node: Typing and Comparison361241 -Node: Variable Typing362061 -Node: Comparison Operators365685 -Ref: table-relational-ops366104 -Node: POSIX String Comparison369599 -Ref: POSIX String Comparison-Footnote-1370673 -Node: Boolean Ops370812 -Ref: Boolean Ops-Footnote-1375294 -Node: Conditional Exp375386 -Node: Function Calls377122 -Node: Precedence381002 -Node: Locales384661 -Node: Expressions Summary386293 -Node: Patterns and Actions388866 -Node: Pattern Overview389986 -Node: Regexp Patterns391663 -Node: Expression Patterns392205 -Node: Ranges395986 -Node: BEGIN/END399094 -Node: Using BEGIN/END399855 -Ref: Using BEGIN/END-Footnote-1402592 -Node: I/O And BEGIN/END402698 -Node: BEGINFILE/ENDFILE405014 -Node: Empty407921 -Node: Using Shell Variables408238 -Node: Action Overview410512 -Node: Statements412837 -Node: If Statement414685 -Node: While Statement416180 -Node: Do Statement418208 -Node: For Statement419356 -Node: Switch Statement422515 -Node: Break Statement424901 -Node: Continue Statement426993 -Node: Next Statement428820 -Node: Nextfile Statement431203 -Node: Exit Statement433855 -Node: Built-in Variables436260 -Node: User-modified437393 -Node: Auto-set444981 -Ref: Auto-set-Footnote-1459230 -Ref: Auto-set-Footnote-2459436 -Node: ARGC and ARGV459492 -Node: Pattern Action Summary463711 -Node: Arrays466141 -Node: Array Basics467470 -Node: Array Intro468314 -Ref: figure-array-elements470289 -Ref: Array Intro-Footnote-1472993 -Node: Reference to Elements473121 -Node: Assigning Elements475585 -Node: Array Example476076 -Node: Scanning an Array477835 -Node: Controlling Scanning480859 -Ref: Controlling Scanning-Footnote-1486258 -Node: Numeric Array Subscripts486574 -Node: Uninitialized Subscripts488758 -Node: Delete490377 -Ref: Delete-Footnote-1493129 -Node: Multidimensional493186 -Node: Multiscanning496281 -Node: Arrays of Arrays497872 -Node: Arrays Summary502640 -Node: Functions504733 -Node: Built-in505771 -Node: Calling Built-in506849 -Node: Numeric Functions508845 -Ref: Numeric Functions-Footnote-1513678 -Ref: Numeric Functions-Footnote-2514035 -Ref: Numeric Functions-Footnote-3514083 -Node: String Functions514355 -Ref: String Functions-Footnote-1537863 -Ref: String Functions-Footnote-2537992 -Ref: String Functions-Footnote-3538240 -Node: Gory Details538327 -Ref: table-sub-escapes540118 -Ref: table-sub-proposed541637 -Ref: table-posix-sub543000 -Ref: table-gensub-escapes544541 -Ref: Gory Details-Footnote-1545364 -Node: I/O Functions545515 -Ref: I/O Functions-Footnote-1552736 -Node: Time Functions552884 -Ref: Time Functions-Footnote-1563389 -Ref: Time Functions-Footnote-2563457 -Ref: Time Functions-Footnote-3563615 -Ref: Time Functions-Footnote-4563726 -Ref: Time Functions-Footnote-5563838 -Ref: Time Functions-Footnote-6564065 -Node: Bitwise Functions564331 -Ref: table-bitwise-ops564925 -Ref: Bitwise Functions-Footnote-1569263 -Node: Type Functions569436 -Node: I18N Functions570592 -Node: User-defined572243 -Node: Definition Syntax573048 -Ref: Definition Syntax-Footnote-1578735 -Node: Function Example578806 -Ref: Function Example-Footnote-1581728 -Node: Function Caveats581750 -Node: Calling A Function582268 -Node: Variable Scope583226 -Node: Pass By Value/Reference586220 -Node: Return Statement589719 -Node: Dynamic Typing592698 -Node: Indirect Calls593628 -Ref: Indirect Calls-Footnote-1603879 -Node: Functions Summary604007 -Node: Library Functions606712 -Ref: Library Functions-Footnote-1610321 -Ref: Library Functions-Footnote-2610464 -Node: Library Names610635 -Ref: Library Names-Footnote-1614096 -Ref: Library Names-Footnote-2614319 -Node: General Functions614405 -Node: Strtonum Function615508 -Node: Assert Function618530 -Node: Round Function621856 -Node: Cliff Random Function623397 -Node: Ordinal Functions624413 -Ref: Ordinal Functions-Footnote-1627476 -Ref: Ordinal Functions-Footnote-2627728 -Node: Join Function627938 -Ref: Join Function-Footnote-1629708 -Node: Getlocaltime Function629908 -Node: Readfile Function633652 -Node: Shell Quoting635626 -Node: Data File Management637027 -Node: Filetrans Function637659 -Node: Rewind Function641756 -Node: File Checking643142 -Ref: File Checking-Footnote-1644476 -Node: Empty Files644677 -Node: Ignoring Assigns646656 -Node: Getopt Function648206 -Ref: Getopt Function-Footnote-1659676 -Node: Passwd Functions659876 -Ref: Passwd Functions-Footnote-1668717 -Node: Group Functions668805 -Ref: Group Functions-Footnote-1676704 -Node: Walking Arrays676911 -Node: Library Functions Summary679921 -Node: Library Exercises681327 -Node: Sample Programs682606 -Node: Running Examples683376 -Node: Clones684104 -Node: Cut Program685328 -Node: Egrep Program695049 -Ref: Egrep Program-Footnote-1702561 -Node: Id Program702671 -Node: Split Program706351 -Ref: Split Program-Footnote-1709810 -Node: Tee Program709939 -Node: Uniq Program712729 -Node: Wc Program720155 -Ref: Wc Program-Footnote-1724410 -Node: Miscellaneous Programs724504 -Node: Dupword Program725717 -Node: Alarm Program727747 -Node: Translate Program732602 -Ref: Translate Program-Footnote-1737167 -Node: Labels Program737437 -Ref: Labels Program-Footnote-1740788 -Node: Word Sorting740872 -Node: History Sorting744944 -Node: Extract Program746779 -Node: Simple Sed754310 -Node: Igawk Program757384 -Ref: Igawk Program-Footnote-1771715 -Ref: Igawk Program-Footnote-2771917 -Ref: Igawk Program-Footnote-3772039 -Node: Anagram Program772154 -Node: Signature Program775216 -Node: Programs Summary776463 -Node: Programs Exercises777678 -Ref: Programs Exercises-Footnote-1781807 -Node: Advanced Features781898 -Node: Nondecimal Data783888 -Node: Array Sorting785479 -Node: Controlling Array Traversal786179 -Ref: Controlling Array Traversal-Footnote-1794548 -Node: Array Sorting Functions794666 -Ref: Array Sorting Functions-Footnote-1798553 -Node: Two-way I/O798749 -Ref: Two-way I/O-Footnote-1803700 -Ref: Two-way I/O-Footnote-2803887 -Node: TCP/IP Networking803969 -Node: Profiling806876 -Node: Advanced Features Summary815147 -Node: Internationalization817083 -Node: I18N and L10N818563 -Node: Explaining gettext819250 -Ref: Explaining gettext-Footnote-1824273 -Ref: Explaining gettext-Footnote-2824458 -Node: Programmer i18n824623 -Ref: Programmer i18n-Footnote-1829479 -Node: Translator i18n829528 -Node: String Extraction830322 -Ref: String Extraction-Footnote-1831455 -Node: Printf Ordering831541 -Ref: Printf Ordering-Footnote-1834327 -Node: I18N Portability834391 -Ref: I18N Portability-Footnote-1836847 -Node: I18N Example836910 -Ref: I18N Example-Footnote-1839716 -Node: Gawk I18N839789 -Node: I18N Summary840434 -Node: Debugger841775 -Node: Debugging842797 -Node: Debugging Concepts843238 -Node: Debugging Terms845047 -Node: Awk Debugging847622 -Node: Sample Debugging Session848528 -Node: Debugger Invocation849062 -Node: Finding The Bug850448 -Node: List of Debugger Commands856926 -Node: Breakpoint Control858259 -Node: Debugger Execution Control861953 -Node: Viewing And Changing Data865315 -Node: Execution Stack868689 -Node: Debugger Info870326 -Node: Miscellaneous Debugger Commands874397 -Node: Readline Support879406 -Node: Limitations880302 -Node: Debugging Summary882411 -Node: Arbitrary Precision Arithmetic883584 -Node: Computer Arithmetic885000 -Ref: table-numeric-ranges888591 -Ref: Computer Arithmetic-Footnote-1889313 -Node: Math Definitions889370 -Ref: table-ieee-formats892684 -Ref: Math Definitions-Footnote-1893287 -Node: MPFR features893392 -Node: FP Math Caution895065 -Ref: FP Math Caution-Footnote-1896137 -Node: Inexactness of computations896506 -Node: Inexact representation897466 -Node: Comparing FP Values898826 -Node: Errors accumulate899908 -Node: Getting Accuracy901341 -Node: Try To Round904051 -Node: Setting precision904950 -Ref: table-predefined-precision-strings905647 -Node: Setting the rounding mode907477 -Ref: table-gawk-rounding-modes907851 -Ref: Setting the rounding mode-Footnote-1911259 -Node: Arbitrary Precision Integers911438 -Ref: Arbitrary Precision Integers-Footnote-1916355 -Node: POSIX Floating Point Problems916504 -Ref: POSIX Floating Point Problems-Footnote-1920386 -Node: Floating point summary920424 -Node: Dynamic Extensions922614 -Node: Extension Intro924167 -Node: Plugin License925433 -Node: Extension Mechanism Outline926230 -Ref: figure-load-extension926669 -Ref: figure-register-new-function928234 -Ref: figure-call-new-function929326 -Node: Extension API Description931389 -Node: Extension API Functions Introduction932923 -Node: General Data Types937782 -Ref: General Data Types-Footnote-1943737 -Node: Memory Allocation Functions944036 -Ref: Memory Allocation Functions-Footnote-1946881 -Node: Constructor Functions946980 -Node: Registration Functions948725 -Node: Extension Functions949410 -Node: Exit Callback Functions951709 -Node: Extension Version String952959 -Node: Input Parsers953622 -Node: Output Wrappers963507 -Node: Two-way processors968019 -Node: Printing Messages970283 -Ref: Printing Messages-Footnote-1971359 -Node: Updating 'ERRNO'971512 -Node: Requesting Values972253 -Ref: table-value-types-returned972992 -Node: Accessing Parameters973875 -Node: Symbol Table Access975111 -Node: Symbol table by name975623 -Node: Symbol table by cookie977644 -Ref: Symbol table by cookie-Footnote-1981793 -Node: Cached values981857 -Ref: Cached values-Footnote-1985358 -Node: Array Manipulation985449 -Ref: Array Manipulation-Footnote-1986540 -Node: Array Data Types986577 -Ref: Array Data Types-Footnote-1989235 -Node: Array Functions989327 -Node: Flattening Arrays993186 -Node: Creating Arrays1000094 -Node: Redirection API1004866 -Node: Extension API Variables1007697 -Node: Extension Versioning1008330 -Node: Extension API Informational Variables1010221 -Node: Extension API Boilerplate1011285 -Node: Finding Extensions1015099 -Node: Extension Example1015659 -Node: Internal File Description1016457 -Node: Internal File Ops1020537 -Ref: Internal File Ops-Footnote-11032299 -Node: Using Internal File Ops1032439 -Ref: Using Internal File Ops-Footnote-11034822 -Node: Extension Samples1035097 -Node: Extension Sample File Functions1036626 -Node: Extension Sample Fnmatch1044275 -Node: Extension Sample Fork1045762 -Node: Extension Sample Inplace1046980 -Node: Extension Sample Ord1049066 -Node: Extension Sample Readdir1049902 -Ref: table-readdir-file-types1050791 -Node: Extension Sample Revout1051596 -Node: Extension Sample Rev2way1052185 -Node: Extension Sample Read write array1052925 -Node: Extension Sample Readfile1054867 -Node: Extension Sample Time1055962 -Node: Extension Sample API Tests1057310 -Node: gawkextlib1057802 -Node: Extension summary1060249 -Node: Extension Exercises1063941 -Node: Language History1065438 -Node: V7/SVR3.11067094 -Node: SVR41069247 -Node: POSIX1070681 -Node: BTL1072061 -Node: POSIX/GNU1072791 -Node: Feature History1078630 -Node: Common Extensions1092949 -Node: Ranges and Locales1094232 -Ref: Ranges and Locales-Footnote-11098848 -Ref: Ranges and Locales-Footnote-21098875 -Ref: Ranges and Locales-Footnote-31099110 -Node: Contributors1099331 -Node: History summary1104900 -Node: Installation1106280 -Node: Gawk Distribution1107225 -Node: Getting1107709 -Node: Extracting1108532 -Node: Distribution contents1110170 -Node: Unix Installation1116266 -Node: Quick Installation1116948 -Node: Shell Startup Files1119362 -Node: Additional Configuration Options1120440 -Node: Configuration Philosophy1122245 -Node: Non-Unix Installation1124615 -Node: PC Installation1125073 -Node: PC Binary Installation1126393 -Node: PC Compiling1128245 -Ref: PC Compiling-Footnote-11131269 -Node: PC Testing1131378 -Node: PC Using1132558 -Node: Cygwin1136672 -Node: MSYS1137442 -Node: VMS Installation1137943 -Node: VMS Compilation1138734 -Ref: VMS Compilation-Footnote-11139964 -Node: VMS Dynamic Extensions1140022 -Node: VMS Installation Details1141707 -Node: VMS Running1143960 -Node: VMS GNV1146801 -Node: VMS Old Gawk1147536 -Node: Bugs1148007 -Node: Other Versions1152121 -Node: Installation summary1158595 -Node: Notes1159653 -Node: Compatibility Mode1160518 -Node: Additions1161300 -Node: Accessing The Source1162225 -Node: Adding Code1163661 -Node: New Ports1169816 -Node: Derived Files1174304 -Ref: Derived Files-Footnote-11179789 -Ref: Derived Files-Footnote-21179824 -Ref: Derived Files-Footnote-31180422 -Node: Future Extensions1180536 -Node: Implementation Limitations1181194 -Node: Extension Design1182377 -Node: Old Extension Problems1183531 -Ref: Old Extension Problems-Footnote-11185049 -Node: Extension New Mechanism Goals1185106 -Ref: Extension New Mechanism Goals-Footnote-11188470 -Node: Extension Other Design Decisions1188659 -Node: Extension Future Growth1190772 -Node: Old Extension Mechanism1191608 -Node: Notes summary1193371 -Node: Basic Concepts1194553 -Node: Basic High Level1195234 -Ref: figure-general-flow1195516 -Ref: figure-process-flow1196201 -Ref: Basic High Level-Footnote-11199502 -Node: Basic Data Typing1199687 -Node: Glossary1203015 -Node: Copying1234961 -Node: GNU Free Documentation License1272500 -Node: Index1297618 +Node: Foreword342508 +Node: Foreword446950 +Node: Preface48482 +Ref: Preface-Footnote-151354 +Ref: Preface-Footnote-251461 +Ref: Preface-Footnote-351695 +Node: History51837 +Node: Names54190 +Ref: Names-Footnote-155284 +Node: This Manual55431 +Ref: This Manual-Footnote-161913 +Node: Conventions62013 +Node: Manual History64368 +Ref: Manual History-Footnote-167364 +Ref: Manual History-Footnote-267405 +Node: How To Contribute67479 +Node: Acknowledgments68608 +Node: Getting Started73476 +Node: Running gawk75915 +Node: One-shot77105 +Node: Read Terminal78368 +Node: Long80400 +Node: Executable Scripts81913 +Ref: Executable Scripts-Footnote-184708 +Node: Comments84811 +Node: Quoting87295 +Node: DOS Quoting92813 +Node: Sample Data Files93488 +Node: Very Simple96083 +Node: Two Rules100985 +Node: More Complex102871 +Node: Statements/Lines105734 +Ref: Statements/Lines-Footnote-1110193 +Node: Other Features110458 +Node: When111395 +Ref: When-Footnote-1113149 +Node: Intro Summary113214 +Node: Invoking Gawk114098 +Node: Command Line115612 +Node: Options116410 +Ref: Options-Footnote-1132061 +Ref: Options-Footnote-2132291 +Node: Other Arguments132316 +Node: Naming Standard Input135263 +Node: Environment Variables136356 +Node: AWKPATH Variable136914 +Ref: AWKPATH Variable-Footnote-1140325 +Ref: AWKPATH Variable-Footnote-2140370 +Node: AWKLIBPATH Variable140631 +Node: Other Environment Variables141888 +Node: Exit Status145526 +Node: Include Files146203 +Node: Loading Shared Libraries149798 +Node: Obsolete151226 +Node: Undocumented151918 +Node: Invoking Summary152215 +Node: Regexp153875 +Node: Regexp Usage155394 +Node: Escape Sequences157431 +Node: Regexp Operators163664 +Ref: Regexp Operators-Footnote-1171081 +Ref: Regexp Operators-Footnote-2171228 +Node: Bracket Expressions171326 +Ref: table-char-classes173349 +Node: Leftmost Longest176295 +Node: Computed Regexps177598 +Node: GNU Regexp Operators181025 +Node: Case-sensitivity184704 +Ref: Case-sensitivity-Footnote-1187600 +Ref: Case-sensitivity-Footnote-2187835 +Node: Strong Regexp Constants187943 +Node: Regexp Summary190885 +Node: Reading Files192491 +Node: Records194654 +Node: awk split records195387 +Node: gawk split records200319 +Ref: gawk split records-Footnote-1204863 +Node: Fields204900 +Node: Nonconstant Fields207641 +Ref: Nonconstant Fields-Footnote-1209877 +Node: Changing Fields210081 +Node: Field Separators216011 +Node: Default Field Splitting218709 +Node: Regexp Field Splitting219827 +Node: Single Character Fields223180 +Node: Command Line Field Separator224240 +Node: Full Line Fields227458 +Ref: Full Line Fields-Footnote-1228980 +Ref: Full Line Fields-Footnote-2229026 +Node: Field Splitting Summary229127 +Node: Constant Size231201 +Node: Splitting By Content235780 +Ref: Splitting By Content-Footnote-1239751 +Node: Multiple Line239914 +Ref: Multiple Line-Footnote-1245797 +Node: Getline245976 +Node: Plain Getline248443 +Node: Getline/Variable251082 +Node: Getline/File252231 +Node: Getline/Variable/File253617 +Ref: Getline/Variable/File-Footnote-1255221 +Node: Getline/Pipe255309 +Node: Getline/Variable/Pipe258014 +Node: Getline/Coprocess259147 +Node: Getline/Variable/Coprocess260412 +Node: Getline Notes261152 +Node: Getline Summary263947 +Ref: table-getline-variants264369 +Node: Read Timeout265117 +Ref: Read Timeout-Footnote-1269024 +Node: Retrying Input269082 +Node: Command-line directories270281 +Node: Input Summary271188 +Node: Input Exercises274360 +Node: Printing275088 +Node: Print276923 +Node: Print Examples278380 +Node: Output Separators281160 +Node: OFMT283177 +Node: Printf284533 +Node: Basic Printf285318 +Node: Control Letters286892 +Node: Format Modifiers290880 +Node: Printf Examples296895 +Node: Redirection299381 +Node: Special FD306224 +Ref: Special FD-Footnote-1309392 +Node: Special Files309466 +Node: Other Inherited Files310083 +Node: Special Network311084 +Node: Special Caveats311944 +Node: Close Files And Pipes312893 +Ref: Close Files And Pipes-Footnote-1320080 +Ref: Close Files And Pipes-Footnote-2320228 +Node: Nonfatal320379 +Node: Output Summary322704 +Node: Output Exercises323926 +Node: Expressions324605 +Node: Values325793 +Node: Constants326471 +Node: Scalar Constants327162 +Ref: Scalar Constants-Footnote-1328026 +Node: Nondecimal-numbers328276 +Node: Regexp Constants331290 +Node: Using Constant Regexps331816 +Node: Variables334979 +Node: Using Variables335636 +Node: Assignment Options337547 +Node: Conversion339421 +Node: Strings And Numbers339945 +Ref: Strings And Numbers-Footnote-1343009 +Node: Locale influences conversions343118 +Ref: table-locale-affects345876 +Node: All Operators346494 +Node: Arithmetic Ops347123 +Node: Concatenation349629 +Ref: Concatenation-Footnote-1352476 +Node: Assignment Ops352583 +Ref: table-assign-ops357575 +Node: Increment Ops358888 +Node: Truth Values and Conditions362348 +Node: Truth Values363422 +Node: Typing and Comparison364470 +Node: Variable Typing365290 +Node: Comparison Operators368914 +Ref: table-relational-ops369333 +Node: POSIX String Comparison372828 +Ref: POSIX String Comparison-Footnote-1373902 +Node: Boolean Ops374041 +Ref: Boolean Ops-Footnote-1378523 +Node: Conditional Exp378615 +Node: Function Calls380351 +Node: Precedence384231 +Node: Locales387890 +Node: Expressions Summary389522 +Node: Patterns and Actions392095 +Node: Pattern Overview393215 +Node: Regexp Patterns394892 +Node: Expression Patterns395434 +Node: Ranges399215 +Node: BEGIN/END402323 +Node: Using BEGIN/END403084 +Ref: Using BEGIN/END-Footnote-1405821 +Node: I/O And BEGIN/END405927 +Node: BEGINFILE/ENDFILE408243 +Node: Empty411150 +Node: Using Shell Variables411467 +Node: Action Overview413741 +Node: Statements416066 +Node: If Statement417914 +Node: While Statement419409 +Node: Do Statement421437 +Node: For Statement422585 +Node: Switch Statement425744 +Node: Break Statement428130 +Node: Continue Statement430222 +Node: Next Statement432049 +Node: Nextfile Statement434432 +Node: Exit Statement437084 +Node: Built-in Variables439489 +Node: User-modified440622 +Node: Auto-set448210 +Ref: Auto-set-Footnote-1462459 +Ref: Auto-set-Footnote-2462665 +Node: ARGC and ARGV462721 +Node: Pattern Action Summary466940 +Node: Arrays469370 +Node: Array Basics470699 +Node: Array Intro471543 +Ref: figure-array-elements473518 +Ref: Array Intro-Footnote-1476222 +Node: Reference to Elements476350 +Node: Assigning Elements478814 +Node: Array Example479305 +Node: Scanning an Array481064 +Node: Controlling Scanning484088 +Ref: Controlling Scanning-Footnote-1489487 +Node: Numeric Array Subscripts489803 +Node: Uninitialized Subscripts491987 +Node: Delete493606 +Ref: Delete-Footnote-1496358 +Node: Multidimensional496415 +Node: Multiscanning499510 +Node: Arrays of Arrays501101 +Node: Arrays Summary505869 +Node: Functions507962 +Node: Built-in509000 +Node: Calling Built-in510078 +Node: Numeric Functions512074 +Ref: Numeric Functions-Footnote-1516907 +Ref: Numeric Functions-Footnote-2517264 +Ref: Numeric Functions-Footnote-3517312 +Node: String Functions517584 +Ref: String Functions-Footnote-1541092 +Ref: String Functions-Footnote-2541221 +Ref: String Functions-Footnote-3541469 +Node: Gory Details541556 +Ref: table-sub-escapes543347 +Ref: table-sub-proposed544866 +Ref: table-posix-sub546229 +Ref: table-gensub-escapes547770 +Ref: Gory Details-Footnote-1548593 +Node: I/O Functions548744 +Ref: I/O Functions-Footnote-1555965 +Node: Time Functions556113 +Ref: Time Functions-Footnote-1566618 +Ref: Time Functions-Footnote-2566686 +Ref: Time Functions-Footnote-3566844 +Ref: Time Functions-Footnote-4566955 +Ref: Time Functions-Footnote-5567067 +Ref: Time Functions-Footnote-6567294 +Node: Bitwise Functions567560 +Ref: table-bitwise-ops568154 +Ref: Bitwise Functions-Footnote-1572492 +Node: Type Functions572665 +Node: I18N Functions574527 +Node: User-defined576178 +Node: Definition Syntax576983 +Ref: Definition Syntax-Footnote-1582670 +Node: Function Example582741 +Ref: Function Example-Footnote-1585663 +Node: Function Caveats585685 +Node: Calling A Function586203 +Node: Variable Scope587161 +Node: Pass By Value/Reference590155 +Node: Return Statement593654 +Node: Dynamic Typing596633 +Node: Indirect Calls597563 +Ref: Indirect Calls-Footnote-1607814 +Node: Functions Summary607942 +Node: Library Functions610647 +Ref: Library Functions-Footnote-1614256 +Ref: Library Functions-Footnote-2614399 +Node: Library Names614570 +Ref: Library Names-Footnote-1618031 +Ref: Library Names-Footnote-2618254 +Node: General Functions618340 +Node: Strtonum Function619443 +Node: Assert Function622465 +Node: Round Function625791 +Node: Cliff Random Function627332 +Node: Ordinal Functions628348 +Ref: Ordinal Functions-Footnote-1631411 +Ref: Ordinal Functions-Footnote-2631663 +Node: Join Function631873 +Ref: Join Function-Footnote-1633643 +Node: Getlocaltime Function633843 +Node: Readfile Function637587 +Node: Shell Quoting639561 +Node: Data File Management640962 +Node: Filetrans Function641594 +Node: Rewind Function645691 +Node: File Checking647077 +Ref: File Checking-Footnote-1648411 +Node: Empty Files648612 +Node: Ignoring Assigns650591 +Node: Getopt Function652141 +Ref: Getopt Function-Footnote-1663611 +Node: Passwd Functions663811 +Ref: Passwd Functions-Footnote-1672652 +Node: Group Functions672740 +Ref: Group Functions-Footnote-1680639 +Node: Walking Arrays680846 +Node: Library Functions Summary683856 +Node: Library Exercises685262 +Node: Sample Programs686541 +Node: Running Examples687311 +Node: Clones688039 +Node: Cut Program689263 +Node: Egrep Program698984 +Ref: Egrep Program-Footnote-1706496 +Node: Id Program706606 +Node: Split Program710286 +Ref: Split Program-Footnote-1713745 +Node: Tee Program713874 +Node: Uniq Program716664 +Node: Wc Program724090 +Ref: Wc Program-Footnote-1728345 +Node: Miscellaneous Programs728439 +Node: Dupword Program729652 +Node: Alarm Program731682 +Node: Translate Program736537 +Ref: Translate Program-Footnote-1741102 +Node: Labels Program741372 +Ref: Labels Program-Footnote-1744723 +Node: Word Sorting744807 +Node: History Sorting748879 +Node: Extract Program750714 +Node: Simple Sed758245 +Node: Igawk Program761319 +Ref: Igawk Program-Footnote-1775650 +Ref: Igawk Program-Footnote-2775852 +Ref: Igawk Program-Footnote-3775974 +Node: Anagram Program776089 +Node: Signature Program779151 +Node: Programs Summary780398 +Node: Programs Exercises781613 +Ref: Programs Exercises-Footnote-1785742 +Node: Advanced Features785833 +Node: Nondecimal Data787823 +Node: Array Sorting789414 +Node: Controlling Array Traversal790114 +Ref: Controlling Array Traversal-Footnote-1798483 +Node: Array Sorting Functions798601 +Ref: Array Sorting Functions-Footnote-1802488 +Node: Two-way I/O802684 +Ref: Two-way I/O-Footnote-1807635 +Ref: Two-way I/O-Footnote-2807822 +Node: TCP/IP Networking807904 +Node: Profiling810811 +Node: Advanced Features Summary819082 +Node: Internationalization821018 +Node: I18N and L10N822498 +Node: Explaining gettext823185 +Ref: Explaining gettext-Footnote-1828208 +Ref: Explaining gettext-Footnote-2828393 +Node: Programmer i18n828558 +Ref: Programmer i18n-Footnote-1833414 +Node: Translator i18n833463 +Node: String Extraction834257 +Ref: String Extraction-Footnote-1835390 +Node: Printf Ordering835476 +Ref: Printf Ordering-Footnote-1838262 +Node: I18N Portability838326 +Ref: I18N Portability-Footnote-1840782 +Node: I18N Example840845 +Ref: I18N Example-Footnote-1843651 +Node: Gawk I18N843724 +Node: I18N Summary844369 +Node: Debugger845710 +Node: Debugging846732 +Node: Debugging Concepts847173 +Node: Debugging Terms848982 +Node: Awk Debugging851557 +Node: Sample Debugging Session852463 +Node: Debugger Invocation852997 +Node: Finding The Bug854383 +Node: List of Debugger Commands860861 +Node: Breakpoint Control862194 +Node: Debugger Execution Control865888 +Node: Viewing And Changing Data869250 +Node: Execution Stack872624 +Node: Debugger Info874261 +Node: Miscellaneous Debugger Commands878332 +Node: Readline Support883341 +Node: Limitations884237 +Node: Debugging Summary886346 +Node: Arbitrary Precision Arithmetic887519 +Node: Computer Arithmetic888935 +Ref: table-numeric-ranges892526 +Ref: Computer Arithmetic-Footnote-1893248 +Node: Math Definitions893305 +Ref: table-ieee-formats896619 +Ref: Math Definitions-Footnote-1897222 +Node: MPFR features897327 +Node: FP Math Caution899000 +Ref: FP Math Caution-Footnote-1900072 +Node: Inexactness of computations900441 +Node: Inexact representation901401 +Node: Comparing FP Values902761 +Node: Errors accumulate903843 +Node: Getting Accuracy905276 +Node: Try To Round907986 +Node: Setting precision908885 +Ref: table-predefined-precision-strings909582 +Node: Setting the rounding mode911412 +Ref: table-gawk-rounding-modes911786 +Ref: Setting the rounding mode-Footnote-1915194 +Node: Arbitrary Precision Integers915373 +Ref: Arbitrary Precision Integers-Footnote-1920290 +Node: POSIX Floating Point Problems920439 +Ref: POSIX Floating Point Problems-Footnote-1924321 +Node: Floating point summary924359 +Node: Dynamic Extensions926549 +Node: Extension Intro928102 +Node: Plugin License929368 +Node: Extension Mechanism Outline930165 +Ref: figure-load-extension930604 +Ref: figure-register-new-function932169 +Ref: figure-call-new-function933261 +Node: Extension API Description935324 +Node: Extension API Functions Introduction936858 +Node: General Data Types941717 +Ref: General Data Types-Footnote-1947672 +Node: Memory Allocation Functions947971 +Ref: Memory Allocation Functions-Footnote-1950816 +Node: Constructor Functions950915 +Node: Registration Functions952660 +Node: Extension Functions953345 +Node: Exit Callback Functions955644 +Node: Extension Version String956894 +Node: Input Parsers957557 +Node: Output Wrappers967442 +Node: Two-way processors971954 +Node: Printing Messages974218 +Ref: Printing Messages-Footnote-1975294 +Node: Updating 'ERRNO'975447 +Node: Requesting Values976188 +Ref: table-value-types-returned976927 +Node: Accessing Parameters977810 +Node: Symbol Table Access979046 +Node: Symbol table by name979558 +Node: Symbol table by cookie981579 +Ref: Symbol table by cookie-Footnote-1985728 +Node: Cached values985792 +Ref: Cached values-Footnote-1989293 +Node: Array Manipulation989384 +Ref: Array Manipulation-Footnote-1990475 +Node: Array Data Types990512 +Ref: Array Data Types-Footnote-1993170 +Node: Array Functions993262 +Node: Flattening Arrays997121 +Node: Creating Arrays1004029 +Node: Redirection API1008801 +Node: Extension API Variables1011632 +Node: Extension Versioning1012265 +Node: Extension API Informational Variables1014156 +Node: Extension API Boilerplate1015220 +Node: Finding Extensions1019034 +Node: Extension Example1019594 +Node: Internal File Description1020392 +Node: Internal File Ops1024472 +Ref: Internal File Ops-Footnote-11036234 +Node: Using Internal File Ops1036374 +Ref: Using Internal File Ops-Footnote-11038757 +Node: Extension Samples1039032 +Node: Extension Sample File Functions1040561 +Node: Extension Sample Fnmatch1048210 +Node: Extension Sample Fork1049697 +Node: Extension Sample Inplace1050915 +Node: Extension Sample Ord1053001 +Node: Extension Sample Readdir1053837 +Ref: table-readdir-file-types1054726 +Node: Extension Sample Revout1055531 +Node: Extension Sample Rev2way1056120 +Node: Extension Sample Read write array1056860 +Node: Extension Sample Readfile1058802 +Node: Extension Sample Time1059897 +Node: Extension Sample API Tests1061245 +Node: gawkextlib1061737 +Node: Extension summary1064184 +Node: Extension Exercises1067876 +Node: Language History1069373 +Node: V7/SVR3.11071029 +Node: SVR41073182 +Node: POSIX1074616 +Node: BTL1075996 +Node: POSIX/GNU1076726 +Node: Feature History1082565 +Node: Common Extensions1096884 +Node: Ranges and Locales1098167 +Ref: Ranges and Locales-Footnote-11102783 +Ref: Ranges and Locales-Footnote-21102810 +Ref: Ranges and Locales-Footnote-31103045 +Node: Contributors1103266 +Node: History summary1108835 +Node: Installation1110215 +Node: Gawk Distribution1111160 +Node: Getting1111644 +Node: Extracting1112467 +Node: Distribution contents1114105 +Node: Unix Installation1120201 +Node: Quick Installation1120883 +Node: Shell Startup Files1123297 +Node: Additional Configuration Options1124375 +Node: Configuration Philosophy1126180 +Node: Non-Unix Installation1128550 +Node: PC Installation1129008 +Node: PC Binary Installation1130328 +Node: PC Compiling1132180 +Ref: PC Compiling-Footnote-11135204 +Node: PC Testing1135313 +Node: PC Using1136493 +Node: Cygwin1140607 +Node: MSYS1141377 +Node: VMS Installation1141878 +Node: VMS Compilation1142669 +Ref: VMS Compilation-Footnote-11143899 +Node: VMS Dynamic Extensions1143957 +Node: VMS Installation Details1145642 +Node: VMS Running1147895 +Node: VMS GNV1150736 +Node: VMS Old Gawk1151471 +Node: Bugs1151942 +Node: Other Versions1156056 +Node: Installation summary1162530 +Node: Notes1163588 +Node: Compatibility Mode1164453 +Node: Additions1165235 +Node: Accessing The Source1166160 +Node: Adding Code1167596 +Node: New Ports1173751 +Node: Derived Files1178239 +Ref: Derived Files-Footnote-11183724 +Ref: Derived Files-Footnote-21183759 +Ref: Derived Files-Footnote-31184357 +Node: Future Extensions1184471 +Node: Implementation Limitations1185129 +Node: Extension Design1186312 +Node: Old Extension Problems1187466 +Ref: Old Extension Problems-Footnote-11188984 +Node: Extension New Mechanism Goals1189041 +Ref: Extension New Mechanism Goals-Footnote-11192405 +Node: Extension Other Design Decisions1192594 +Node: Extension Future Growth1194707 +Node: Old Extension Mechanism1195543 +Node: Notes summary1197306 +Node: Basic Concepts1198488 +Node: Basic High Level1199169 +Ref: figure-general-flow1199451 +Ref: figure-process-flow1200136 +Ref: Basic High Level-Footnote-11203437 +Node: Basic Data Typing1203622 +Node: Glossary1206950 +Node: Copying1238896 +Node: GNU Free Documentation License1276435 +Node: Index1301553 End Tag Table |