diff options
Diffstat (limited to 'doc/gawk.info')
-rw-r--r-- | doc/gawk.info | 1251 |
1 files changed, 644 insertions, 607 deletions
diff --git a/doc/gawk.info b/doc/gawk.info index 55ddd990..0d4ec9f9 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -437,6 +437,8 @@ in (a) below. A copy of the license is included in the section entitled once. * Shell Quoting:: A function to quote strings for the shell. +* Isnumeric Function:: A function to test whether a value + is numeric. * Data File Management:: Functions for managing command-line data files. * Filetrans Function:: A function for handling data file @@ -15736,6 +15738,7 @@ programming use. * Getlocaltime Function:: A function to get formatted times. * Readfile Function:: A function to read an entire file at once. * Shell Quoting:: A function to quote strings for the shell. +* Isnumeric Function:: A function to test whether a value is numeric. File: gawk.info, Node: Strtonum Function, Next: Assert Function, Up: General Functions @@ -16271,7 +16274,7 @@ test would be 'contents == ""'. reads an entire file into memory. -File: gawk.info, Node: Shell Quoting, Prev: Readfile Function, Up: General Functions +File: gawk.info, Node: Shell Quoting, Next: Isnumeric Function, Prev: Readfile Function, Up: General Functions 10.2.9 Quoting Strings to Pass to the Shell ------------------------------------------- @@ -16323,6 +16326,37 @@ three-character string '"\"'\""': } +File: gawk.info, Node: Isnumeric Function, Prev: Shell Quoting, Up: General Functions + +10.2.10 Checking Whether A Value Is Numeric +------------------------------------------- + +A frequent programming question is how to ascertain whether a value is +numeric. This can be solved by using this example function +'isnumeric()', which employs the trick of converting a string value to +user input by using the 'split()' function: + + # isnumeric --- check whether a value is numeric + + function isnumeric(x, f) + { + switch (typeof(x)) { + case "strnum": + case "number": + return 1 + case "string": + return (split(x, f, " ") == 1) && (typeof(f[1]) == "strnum") + default: + return 0 + } + } + + Please note that leading or trailing white space is disregarded in deciding + whether a value is numeric or not, so if it matters to you, you may want + to add an additional check for that. + + + File: gawk.info, Node: Data File Management, Next: Getopt Function, Prev: General Functions, Up: Library Functions 10.3 Data file Management @@ -16993,8 +17027,8 @@ results of some sample runs of the test program: -| c = <otherd>, Optarg = <> -| c = <otherc>, Optarg = <> -| non-option arguments: - -| ARGV[8] = <arg1> - -| ARGV[9] = <arg2> + -| ARGV[8] = <arg1> + -| ARGV[9] = <arg2> In all the runs, the first '--' terminates the arguments to 'awk', so that it does not try to interpret the '-a', etc., as its own options. @@ -18580,7 +18614,7 @@ the function's lines short so that they look nice on the page: # # Requires getopt() library function. - function usage( common) + function usage( common) { common = "[-a suffix-len] [file [outname]]" printf("usage: split [-l count] %s\n", common) > "/dev/stderr" @@ -21555,7 +21589,7 @@ purpose: printf("%d\n", x + y); return 0; } - $ cc -O add.c -o add Compile the program + $ cc -O add.c -o add Compile the program You could then write an exceedingly simple 'gawk' program to add numbers by passing them to the coprocess: @@ -36910,6 +36944,7 @@ Index * inventory-shipped file: Sample Data Files. (line 32) * invoke shell command: I/O Functions. (line 106) * isarray: Type Functions. (line 11) +* isnumeric() user-defined function: Isnumeric Function. (line 11) * ISO, ISO 8601 date and time standard: Time Functions. (line 186) * ISO, ISO 8859-1 character set: Glossary. (line 194) * ISO, ISO Latin-1 character set: Glossary. (line 194) @@ -38189,6 +38224,7 @@ Index * user-defined, function, getlocaltime(): Getlocaltime Function. (line 16) * user-defined, function, readfile(): Readfile Function. (line 30) +* user-defined, function, isnumeric(): Isnumeric Function. (line 11) * user-defined, function, beginfile(): Filetrans Function. (line 62) * user-defined, function, endfile(): Filetrans Function. (line 62) * user-defined, function, rewind(): Rewind Function. (line 15) @@ -38319,608 +38355,609 @@ Index Tag Table: Node: Top1200 -Node: Foreword345205 -Node: Foreword449647 -Node: Preface51179 -Ref: Preface-Footnote-154038 -Ref: Preface-Footnote-254147 -Ref: Preface-Footnote-354381 -Node: History54523 -Node: Names56875 -Ref: Names-Footnote-157979 -Node: This Manual58126 -Ref: This Manual-Footnote-164765 -Node: Conventions64865 -Node: Manual History67234 -Ref: Manual History-Footnote-170231 -Ref: Manual History-Footnote-270272 -Node: How To Contribute70346 -Node: Acknowledgments71272 -Node: Getting Started76209 -Node: Running gawk78648 -Node: One-shot79838 -Node: Read Terminal81101 -Node: Long83094 -Node: Executable Scripts84607 -Ref: Executable Scripts-Footnote-187240 -Node: Comments87343 -Node: Quoting89827 -Node: DOS Quoting95353 -Node: Sample Data Files97409 -Node: Very Simple100004 -Node: Two Rules106106 -Node: More Complex107991 -Node: Statements/Lines110323 -Ref: Statements/Lines-Footnote-1114807 -Node: Other Features115072 -Node: When116008 -Ref: When-Footnote-1117762 -Node: Intro Summary117827 -Node: Invoking Gawk118711 -Node: Command Line120225 -Node: Options121023 -Ref: Options-Footnote-1138937 -Ref: Options-Footnote-2139168 -Node: Other Arguments139193 -Node: Naming Standard Input143204 -Node: Environment Variables144414 -Node: AWKPATH Variable144972 -Ref: AWKPATH Variable-Footnote-1148384 -Ref: AWKPATH Variable-Footnote-2148418 -Node: AWKLIBPATH Variable148789 -Ref: AWKLIBPATH Variable-Footnote-1150486 -Node: Other Environment Variables150861 -Node: Exit Status154813 -Node: Include Files155490 -Node: Loading Shared Libraries159180 -Node: Obsolete160608 -Node: Undocumented161300 -Node: Invoking Summary161597 -Node: Regexp164438 -Node: Regexp Usage165892 -Node: Escape Sequences167929 -Node: Regexp Operators174170 -Node: Regexp Operator Details174655 -Ref: Regexp Operator Details-Footnote-1182019 -Node: Interval Expressions182166 -Ref: Interval Expressions-Footnote-1183587 -Node: Bracket Expressions183685 -Ref: table-char-classes186161 -Node: Leftmost Longest189487 -Node: Computed Regexps190790 -Node: GNU Regexp Operators194217 -Node: Case-sensitivity197954 -Ref: Case-sensitivity-Footnote-1200820 -Ref: Case-sensitivity-Footnote-2201055 -Node: Regexp Summary201163 -Node: Reading Files202629 -Node: Records204898 -Node: awk split records205973 -Node: gawk split records210673 -Ref: gawk split records-Footnote-1215747 -Node: Fields215784 -Node: Nonconstant Fields218525 -Ref: Nonconstant Fields-Footnote-1220761 -Node: Changing Fields220965 -Node: Field Separators226996 -Node: Default Field Splitting229694 -Node: Regexp Field Splitting230812 -Node: Single Character Fields234489 -Node: Command Line Field Separator235549 -Node: Full Line Fields238767 -Ref: Full Line Fields-Footnote-1240289 -Ref: Full Line Fields-Footnote-2240335 -Node: Field Splitting Summary240436 -Node: Constant Size242510 -Node: Fixed width data243242 -Node: Skipping intervening246709 -Node: Allowing trailing data247507 -Node: Fields with fixed data248544 -Node: Splitting By Content250062 -Ref: Splitting By Content-Footnote-1253845 -Node: More CSV254008 -Node: Testing field creation255600 -Node: Multiple Line257225 -Node: Getline263502 -Node: Plain Getline265971 -Node: Getline/Variable268544 -Node: Getline/File269695 -Node: Getline/Variable/File271083 -Ref: Getline/Variable/File-Footnote-1272688 -Node: Getline/Pipe272776 -Node: Getline/Variable/Pipe275480 -Node: Getline/Coprocess276615 -Node: Getline/Variable/Coprocess277882 -Node: Getline Notes278624 -Node: Getline Summary281421 -Ref: table-getline-variants281845 -Node: Read Timeout282593 -Ref: Read Timeout-Footnote-1286499 -Node: Retrying Input286557 -Node: Command-line directories287756 -Node: Input Summary288662 -Node: Input Exercises291834 -Node: Printing292268 -Node: Print294102 -Node: Print Examples295559 -Node: Output Separators298339 -Node: OFMT300356 -Node: Printf301712 -Node: Basic Printf302497 -Node: Control Letters304071 -Node: Format Modifiers309233 -Node: Printf Examples315248 -Node: Redirection317734 -Node: Special FD324575 -Ref: Special FD-Footnote-1327743 -Node: Special Files327817 -Node: Other Inherited Files328434 -Node: Special Network329435 -Node: Special Caveats330295 -Node: Close Files And Pipes331244 -Ref: table-close-pipe-return-values338151 -Ref: Close Files And Pipes-Footnote-1338964 -Ref: Close Files And Pipes-Footnote-2339112 -Node: Nonfatal339264 -Node: Output Summary341602 -Node: Output Exercises342824 -Node: Expressions343503 -Node: Values344691 -Node: Constants345369 -Node: Scalar Constants346060 -Ref: Scalar Constants-Footnote-1348570 -Node: Nondecimal-numbers348820 -Node: Regexp Constants351821 -Node: Using Constant Regexps352347 -Node: Standard Regexp Constants352969 -Node: Strong Regexp Constants356157 -Node: Variables359169 -Node: Using Variables359826 -Node: Assignment Options361736 -Node: Conversion364207 -Node: Strings And Numbers364731 -Ref: Strings And Numbers-Footnote-1367794 -Node: Locale influences conversions367903 -Ref: table-locale-affects370661 -Node: All Operators371279 -Node: Arithmetic Ops371908 -Node: Concatenation374624 -Ref: Concatenation-Footnote-1377471 -Node: Assignment Ops377578 -Ref: table-assign-ops382569 -Node: Increment Ops383882 -Node: Truth Values and Conditions387342 -Node: Truth Values388416 -Node: Typing and Comparison389464 -Node: Variable Typing390284 -Ref: Variable Typing-Footnote-1396747 -Ref: Variable Typing-Footnote-2396819 -Node: Comparison Operators396896 -Ref: table-relational-ops397315 -Node: POSIX String Comparison400810 -Ref: POSIX String Comparison-Footnote-1402505 -Ref: POSIX String Comparison-Footnote-2402644 -Node: Boolean Ops402728 -Ref: Boolean Ops-Footnote-1407210 -Node: Conditional Exp407302 -Node: Function Calls409038 -Node: Precedence412915 -Node: Locales416574 -Node: Expressions Summary418206 -Node: Patterns and Actions420779 -Node: Pattern Overview421899 -Node: Regexp Patterns423576 -Node: Expression Patterns424118 -Node: Ranges427899 -Node: BEGIN/END431007 -Node: Using BEGIN/END431768 -Ref: Using BEGIN/END-Footnote-1434522 -Node: I/O And BEGIN/END434628 -Node: BEGINFILE/ENDFILE436941 -Node: Empty440172 -Node: Using Shell Variables440489 -Node: Action Overview442763 -Node: Statements445088 -Node: If Statement446936 -Node: While Statement448431 -Node: Do Statement450459 -Node: For Statement451607 -Node: Switch Statement454778 -Node: Break Statement457219 -Node: Continue Statement459311 -Node: Next Statement461138 -Node: Nextfile Statement463521 -Node: Exit Statement466210 -Node: Built-in Variables468613 -Node: User-modified469746 -Node: Auto-set477513 -Ref: Auto-set-Footnote-1494320 -Ref: Auto-set-Footnote-2494526 -Node: ARGC and ARGV494582 -Node: Pattern Action Summary498795 -Node: Arrays501225 -Node: Array Basics502554 -Node: Array Intro503398 -Ref: figure-array-elements505373 -Ref: Array Intro-Footnote-1508077 -Node: Reference to Elements508205 -Node: Assigning Elements510669 -Node: Array Example511160 -Node: Scanning an Array512919 -Node: Controlling Scanning515941 -Ref: Controlling Scanning-Footnote-1522397 -Node: Numeric Array Subscripts522713 -Node: Uninitialized Subscripts524897 -Node: Delete526516 -Ref: Delete-Footnote-1529268 -Node: Multidimensional529325 -Node: Multiscanning532420 -Node: Arrays of Arrays534011 -Node: Arrays Summary538779 -Node: Functions540872 -Node: Built-in541910 -Node: Calling Built-in543063 -Node: Boolean Functions545059 -Node: Numeric Functions545613 -Ref: Numeric Functions-Footnote-1549640 -Ref: Numeric Functions-Footnote-2550288 -Ref: Numeric Functions-Footnote-3550336 -Node: String Functions550608 -Ref: String Functions-Footnote-1574749 -Ref: String Functions-Footnote-2574877 -Ref: String Functions-Footnote-3575125 -Node: Gory Details575212 -Ref: table-sub-escapes577003 -Ref: table-sub-proposed578522 -Ref: table-posix-sub579885 -Ref: table-gensub-escapes581426 -Ref: Gory Details-Footnote-1582249 -Node: I/O Functions582403 -Ref: table-system-return-values588857 -Ref: I/O Functions-Footnote-1590937 -Ref: I/O Functions-Footnote-2591085 -Node: Time Functions591205 -Ref: Time Functions-Footnote-1601876 -Ref: Time Functions-Footnote-2601944 -Ref: Time Functions-Footnote-3602102 -Ref: Time Functions-Footnote-4602213 -Ref: Time Functions-Footnote-5602325 -Ref: Time Functions-Footnote-6602552 -Node: Bitwise Functions602818 -Ref: table-bitwise-ops603412 -Ref: Bitwise Functions-Footnote-1609475 -Ref: Bitwise Functions-Footnote-2609648 -Node: Type Functions609839 -Node: I18N Functions612793 -Node: User-defined614444 -Node: Definition Syntax615256 -Ref: Definition Syntax-Footnote-1620950 -Node: Function Example621021 -Ref: Function Example-Footnote-1623943 -Node: Function Calling623965 -Node: Calling A Function624553 -Node: Variable Scope625511 -Node: Pass By Value/Reference628505 -Node: Function Caveats631149 -Ref: Function Caveats-Footnote-1633196 -Node: Return Statement633316 -Node: Dynamic Typing636295 -Node: Indirect Calls637225 -Ref: Indirect Calls-Footnote-1647480 -Node: Functions Summary647608 -Node: Library Functions650313 -Ref: Library Functions-Footnote-1653920 -Ref: Library Functions-Footnote-2654063 -Node: Library Names654234 -Ref: Library Names-Footnote-1657901 -Ref: Library Names-Footnote-2658124 -Node: General Functions658210 -Node: Strtonum Function659313 -Node: Assert Function662335 -Node: Round Function665661 -Node: Cliff Random Function667201 -Node: Ordinal Functions668217 -Ref: Ordinal Functions-Footnote-1671280 -Ref: Ordinal Functions-Footnote-2671532 -Node: Join Function671742 -Ref: Join Function-Footnote-1673512 -Node: Getlocaltime Function673712 -Node: Readfile Function677454 -Node: Shell Quoting679431 -Node: Data File Management680832 -Node: Filetrans Function681464 -Node: Rewind Function685560 -Node: File Checking687469 -Ref: File Checking-Footnote-1688803 -Node: Empty Files689004 -Node: Ignoring Assigns690983 -Node: Getopt Function692533 -Ref: Getopt Function-Footnote-1707744 -Node: Passwd Functions707944 -Ref: Passwd Functions-Footnote-1716783 -Node: Group Functions716871 -Ref: Group Functions-Footnote-1724769 -Node: Walking Arrays724976 -Node: Library Functions Summary727984 -Node: Library Exercises729390 -Node: Sample Programs729855 -Node: Running Examples730625 -Node: Clones731353 -Node: Cut Program732577 -Node: Egrep Program742717 -Node: Id Program751718 -Node: Split Program761665 -Ref: Split Program-Footnote-1771555 -Node: Tee Program771728 -Node: Uniq Program774518 -Node: Wc Program782106 -Node: Bytes vs. Characters782493 -Node: Using extensions784041 -Node: wc program784795 -Node: Miscellaneous Programs789660 -Node: Dupword Program790873 -Node: Alarm Program792903 -Node: Translate Program797758 -Ref: Translate Program-Footnote-1802323 -Node: Labels Program802593 -Ref: Labels Program-Footnote-1805944 -Node: Word Sorting806028 -Node: History Sorting810100 -Node: Extract Program812325 -Node: Simple Sed820379 -Node: Igawk Program823453 -Ref: Igawk Program-Footnote-1837784 -Ref: Igawk Program-Footnote-2837986 -Ref: Igawk Program-Footnote-3838108 -Node: Anagram Program838223 -Node: Signature Program841285 -Node: Programs Summary842532 -Node: Programs Exercises843746 -Ref: Programs Exercises-Footnote-1847876 -Node: Advanced Features847962 -Node: Nondecimal Data850093 -Node: Boolean Typed Values851691 -Node: Array Sorting853572 -Node: Controlling Array Traversal854277 -Ref: Controlling Array Traversal-Footnote-1862645 -Node: Array Sorting Functions862763 -Ref: Array Sorting Functions-Footnote-1867854 -Node: Two-way I/O868050 -Ref: Two-way I/O-Footnote-1875771 -Ref: Two-way I/O-Footnote-2875958 -Node: TCP/IP Networking876040 -Node: Profiling879158 -Node: Extension Philosophy888467 -Node: Advanced Features Summary889946 -Node: Internationalization891961 -Node: I18N and L10N893635 -Node: Explaining gettext894322 -Ref: Explaining gettext-Footnote-1900214 -Ref: Explaining gettext-Footnote-2900399 -Node: Programmer i18n900564 -Ref: Programmer i18n-Footnote-1905513 -Node: Translator i18n905562 -Node: String Extraction906356 -Ref: String Extraction-Footnote-1907488 -Node: Printf Ordering907574 -Ref: Printf Ordering-Footnote-1910360 -Node: I18N Portability910424 -Ref: I18N Portability-Footnote-1912880 -Node: I18N Example912943 -Ref: I18N Example-Footnote-1916218 -Ref: I18N Example-Footnote-2916291 -Node: Gawk I18N916400 -Node: I18N Summary917049 -Node: Debugger918390 -Node: Debugging919390 -Node: Debugging Concepts919831 -Node: Debugging Terms921640 -Node: Awk Debugging924215 -Ref: Awk Debugging-Footnote-1925160 -Node: Sample Debugging Session925292 -Node: Debugger Invocation925826 -Node: Finding The Bug927212 -Node: List of Debugger Commands933686 -Node: Breakpoint Control935019 -Node: Debugger Execution Control938713 -Node: Viewing And Changing Data942075 -Node: Execution Stack945616 -Node: Debugger Info947253 -Node: Miscellaneous Debugger Commands951324 -Node: Readline Support956386 -Node: Limitations957282 -Node: Debugging Summary959836 -Node: Namespaces961115 -Node: Global Namespace962226 -Node: Qualified Names963624 -Node: Default Namespace964623 -Node: Changing The Namespace965364 -Node: Naming Rules966978 -Node: Internal Name Management968826 -Node: Namespace Example969868 -Node: Namespace And Features972430 -Node: Namespace Summary973865 -Node: Arbitrary Precision Arithmetic975342 -Node: Computer Arithmetic976829 -Ref: table-numeric-ranges980595 -Ref: table-floating-point-ranges981088 -Ref: Computer Arithmetic-Footnote-1981746 -Node: Math Definitions981803 -Ref: table-ieee-formats984779 -Node: MPFR features985346 -Node: FP Math Caution987064 -Ref: FP Math Caution-Footnote-1988136 -Node: Inexactness of computations988505 -Node: Inexact representation989536 -Node: Comparing FP Values990896 -Node: Errors accumulate992137 -Node: Strange values993593 -Ref: Strange values-Footnote-1996181 -Node: Getting Accuracy996286 -Node: Try To Round998996 -Node: Setting precision999895 -Ref: table-predefined-precision-strings1000592 -Node: Setting the rounding mode1002422 -Ref: table-gawk-rounding-modes1002796 -Ref: Setting the rounding mode-Footnote-11006727 -Node: Arbitrary Precision Integers1006906 -Ref: Arbitrary Precision Integers-Footnote-11010081 -Node: Checking for MPFR1010230 -Node: POSIX Floating Point Problems1011704 -Ref: POSIX Floating Point Problems-Footnote-11015989 -Node: Floating point summary1016027 -Node: Dynamic Extensions1018217 -Node: Extension Intro1019770 -Node: Plugin License1021036 -Node: Extension Mechanism Outline1021833 -Ref: figure-load-extension1022272 -Ref: figure-register-new-function1023837 -Ref: figure-call-new-function1024929 -Node: Extension API Description1026991 -Node: Extension API Functions Introduction1028704 -Ref: table-api-std-headers1030540 -Node: General Data Types1034789 -Ref: General Data Types-Footnote-11043495 -Node: Memory Allocation Functions1043794 -Ref: Memory Allocation Functions-Footnote-11048295 -Node: Constructor Functions1048394 -Node: API Ownership of MPFR and GMP Values1052047 -Node: Registration Functions1053360 -Node: Extension Functions1054060 -Node: Exit Callback Functions1059382 -Node: Extension Version String1060632 -Node: Input Parsers1061295 -Node: Output Wrappers1074016 -Node: Two-way processors1078528 -Node: Printing Messages1080793 -Ref: Printing Messages-Footnote-11081964 -Node: Updating ERRNO1082117 -Node: Requesting Values1082856 -Ref: table-value-types-returned1083593 -Node: Accessing Parameters1084701 -Node: Symbol Table Access1085938 -Node: Symbol table by name1086450 -Ref: Symbol table by name-Footnote-11089474 -Node: Symbol table by cookie1089602 -Ref: Symbol table by cookie-Footnote-11093787 -Node: Cached values1093851 -Ref: Cached values-Footnote-11097387 -Node: Array Manipulation1097540 -Ref: Array Manipulation-Footnote-11098631 -Node: Array Data Types1098668 -Ref: Array Data Types-Footnote-11101326 -Node: Array Functions1101418 -Node: Flattening Arrays1105916 -Node: Creating Arrays1112892 -Node: Redirection API1117659 -Node: Extension API Variables1120492 -Node: Extension Versioning1121203 -Ref: gawk-api-version1121632 -Node: Extension GMP/MPFR Versioning1123363 -Node: Extension API Informational Variables1124991 -Node: Extension API Boilerplate1126064 -Node: Changes from API V11130038 -Node: Finding Extensions1131610 -Node: Extension Example1132169 -Node: Internal File Description1132967 -Node: Internal File Ops1137047 -Ref: Internal File Ops-Footnote-11148397 -Node: Using Internal File Ops1148537 -Ref: Using Internal File Ops-Footnote-11150920 -Node: Extension Samples1151194 -Node: Extension Sample File Functions1152723 -Node: Extension Sample Fnmatch1160372 -Node: Extension Sample Fork1161859 -Node: Extension Sample Inplace1163077 -Node: Extension Sample Ord1166703 -Node: Extension Sample Readdir1167539 -Ref: table-readdir-file-types1168428 -Node: Extension Sample Revout1169495 -Node: Extension Sample Rev2way1170084 -Node: Extension Sample Read write array1170824 -Node: Extension Sample Readfile1172766 -Node: Extension Sample Time1173861 -Node: Extension Sample API Tests1175613 -Node: gawkextlib1176105 -Node: Extension summary1179023 -Node: Extension Exercises1182725 -Node: Language History1183967 -Node: V7/SVR3.11185623 -Node: SVR41187775 -Node: POSIX1189209 -Node: BTL1190590 -Node: POSIX/GNU1191319 -Node: Feature History1197097 -Node: Common Extensions1214272 -Node: Ranges and Locales1215555 -Ref: Ranges and Locales-Footnote-11220171 -Ref: Ranges and Locales-Footnote-21220198 -Ref: Ranges and Locales-Footnote-31220433 -Node: Contributors1220656 -Node: History summary1226653 -Node: Installation1228033 -Node: Gawk Distribution1228977 -Node: Getting1229461 -Node: Extracting1230424 -Node: Distribution contents1232062 -Node: Unix Installation1238542 -Node: Quick Installation1239224 -Node: Compiling with MPFR1241705 -Node: Shell Startup Files1242397 -Node: Additional Configuration Options1243486 -Node: Configuration Philosophy1245801 -Node: Non-Unix Installation1248170 -Node: PC Installation1248630 -Node: PC Binary Installation1249468 -Node: PC Compiling1249903 -Node: PC Using1251020 -Node: Cygwin1254573 -Node: MSYS1255797 -Node: VMS Installation1256399 -Node: VMS Compilation1257190 -Ref: VMS Compilation-Footnote-11258419 -Node: VMS Dynamic Extensions1258477 -Node: VMS Installation Details1260162 -Node: VMS Running1262415 -Node: VMS GNV1266694 -Node: VMS Old Gawk1267429 -Node: Bugs1267900 -Node: Bug address1268649 -Node: Usenet1271631 -Node: Performance bugs1272640 -Node: Maintainers1275497 -Node: Other Versions1276692 -Node: Installation summary1284557 -Node: Notes1285766 -Node: Compatibility Mode1286560 -Node: Additions1287342 -Node: Accessing The Source1288267 -Node: Adding Code1289704 -Node: New Ports1295923 -Node: Derived Files1300298 -Ref: Derived Files-Footnote-11305958 -Ref: Derived Files-Footnote-21305993 -Ref: Derived Files-Footnote-31306591 -Node: Future Extensions1306705 -Node: Implementation Limitations1307363 -Node: Extension Design1308573 -Node: Old Extension Problems1309717 -Ref: Old Extension Problems-Footnote-11311235 -Node: Extension New Mechanism Goals1311292 -Ref: Extension New Mechanism Goals-Footnote-11314656 -Node: Extension Other Design Decisions1314845 -Node: Extension Future Growth1316958 -Node: Notes summary1317564 -Node: Basic Concepts1318722 -Node: Basic High Level1319403 -Ref: figure-general-flow1319685 -Ref: figure-process-flow1320370 -Ref: Basic High Level-Footnote-11323671 -Node: Basic Data Typing1323856 -Node: Glossary1327184 -Node: Copying1359071 -Node: GNU Free Documentation License1396614 -Node: Index1421734 +Node: Foreword345332 +Node: Foreword449774 +Node: Preface51306 +Ref: Preface-Footnote-154165 +Ref: Preface-Footnote-254274 +Ref: Preface-Footnote-354508 +Node: History54650 +Node: Names57002 +Ref: Names-Footnote-158106 +Node: This Manual58253 +Ref: This Manual-Footnote-164892 +Node: Conventions64992 +Node: Manual History67361 +Ref: Manual History-Footnote-170358 +Ref: Manual History-Footnote-270399 +Node: How To Contribute70473 +Node: Acknowledgments71399 +Node: Getting Started76336 +Node: Running gawk78775 +Node: One-shot79965 +Node: Read Terminal81228 +Node: Long83221 +Node: Executable Scripts84734 +Ref: Executable Scripts-Footnote-187367 +Node: Comments87470 +Node: Quoting89954 +Node: DOS Quoting95480 +Node: Sample Data Files97536 +Node: Very Simple100131 +Node: Two Rules106233 +Node: More Complex108118 +Node: Statements/Lines110450 +Ref: Statements/Lines-Footnote-1114934 +Node: Other Features115199 +Node: When116135 +Ref: When-Footnote-1117889 +Node: Intro Summary117954 +Node: Invoking Gawk118838 +Node: Command Line120352 +Node: Options121150 +Ref: Options-Footnote-1139064 +Ref: Options-Footnote-2139295 +Node: Other Arguments139320 +Node: Naming Standard Input143331 +Node: Environment Variables144541 +Node: AWKPATH Variable145099 +Ref: AWKPATH Variable-Footnote-1148511 +Ref: AWKPATH Variable-Footnote-2148545 +Node: AWKLIBPATH Variable148916 +Ref: AWKLIBPATH Variable-Footnote-1150613 +Node: Other Environment Variables150988 +Node: Exit Status154940 +Node: Include Files155617 +Node: Loading Shared Libraries159307 +Node: Obsolete160735 +Node: Undocumented161427 +Node: Invoking Summary161724 +Node: Regexp164565 +Node: Regexp Usage166019 +Node: Escape Sequences168056 +Node: Regexp Operators174297 +Node: Regexp Operator Details174782 +Ref: Regexp Operator Details-Footnote-1182146 +Node: Interval Expressions182293 +Ref: Interval Expressions-Footnote-1183714 +Node: Bracket Expressions183812 +Ref: table-char-classes186288 +Node: Leftmost Longest189614 +Node: Computed Regexps190917 +Node: GNU Regexp Operators194344 +Node: Case-sensitivity198081 +Ref: Case-sensitivity-Footnote-1200947 +Ref: Case-sensitivity-Footnote-2201182 +Node: Regexp Summary201290 +Node: Reading Files202756 +Node: Records205025 +Node: awk split records206100 +Node: gawk split records210800 +Ref: gawk split records-Footnote-1215874 +Node: Fields215911 +Node: Nonconstant Fields218652 +Ref: Nonconstant Fields-Footnote-1220888 +Node: Changing Fields221092 +Node: Field Separators227123 +Node: Default Field Splitting229821 +Node: Regexp Field Splitting230939 +Node: Single Character Fields234616 +Node: Command Line Field Separator235676 +Node: Full Line Fields238894 +Ref: Full Line Fields-Footnote-1240416 +Ref: Full Line Fields-Footnote-2240462 +Node: Field Splitting Summary240563 +Node: Constant Size242637 +Node: Fixed width data243369 +Node: Skipping intervening246836 +Node: Allowing trailing data247634 +Node: Fields with fixed data248671 +Node: Splitting By Content250189 +Ref: Splitting By Content-Footnote-1253972 +Node: More CSV254135 +Node: Testing field creation255727 +Node: Multiple Line257352 +Node: Getline263629 +Node: Plain Getline266098 +Node: Getline/Variable268671 +Node: Getline/File269822 +Node: Getline/Variable/File271210 +Ref: Getline/Variable/File-Footnote-1272815 +Node: Getline/Pipe272903 +Node: Getline/Variable/Pipe275607 +Node: Getline/Coprocess276742 +Node: Getline/Variable/Coprocess278009 +Node: Getline Notes278751 +Node: Getline Summary281548 +Ref: table-getline-variants281972 +Node: Read Timeout282720 +Ref: Read Timeout-Footnote-1286626 +Node: Retrying Input286684 +Node: Command-line directories287883 +Node: Input Summary288789 +Node: Input Exercises291961 +Node: Printing292395 +Node: Print294229 +Node: Print Examples295686 +Node: Output Separators298466 +Node: OFMT300483 +Node: Printf301839 +Node: Basic Printf302624 +Node: Control Letters304198 +Node: Format Modifiers309360 +Node: Printf Examples315375 +Node: Redirection317861 +Node: Special FD324702 +Ref: Special FD-Footnote-1327870 +Node: Special Files327944 +Node: Other Inherited Files328561 +Node: Special Network329562 +Node: Special Caveats330422 +Node: Close Files And Pipes331371 +Ref: table-close-pipe-return-values338278 +Ref: Close Files And Pipes-Footnote-1339091 +Ref: Close Files And Pipes-Footnote-2339239 +Node: Nonfatal339391 +Node: Output Summary341729 +Node: Output Exercises342951 +Node: Expressions343630 +Node: Values344818 +Node: Constants345496 +Node: Scalar Constants346187 +Ref: Scalar Constants-Footnote-1348697 +Node: Nondecimal-numbers348947 +Node: Regexp Constants351948 +Node: Using Constant Regexps352474 +Node: Standard Regexp Constants353096 +Node: Strong Regexp Constants356284 +Node: Variables359296 +Node: Using Variables359953 +Node: Assignment Options361863 +Node: Conversion364334 +Node: Strings And Numbers364858 +Ref: Strings And Numbers-Footnote-1367921 +Node: Locale influences conversions368030 +Ref: table-locale-affects370788 +Node: All Operators371406 +Node: Arithmetic Ops372035 +Node: Concatenation374751 +Ref: Concatenation-Footnote-1377598 +Node: Assignment Ops377705 +Ref: table-assign-ops382696 +Node: Increment Ops384009 +Node: Truth Values and Conditions387469 +Node: Truth Values388543 +Node: Typing and Comparison389591 +Node: Variable Typing390411 +Ref: Variable Typing-Footnote-1396874 +Ref: Variable Typing-Footnote-2396946 +Node: Comparison Operators397023 +Ref: table-relational-ops397442 +Node: POSIX String Comparison400937 +Ref: POSIX String Comparison-Footnote-1402632 +Ref: POSIX String Comparison-Footnote-2402771 +Node: Boolean Ops402855 +Ref: Boolean Ops-Footnote-1407337 +Node: Conditional Exp407429 +Node: Function Calls409165 +Node: Precedence413042 +Node: Locales416701 +Node: Expressions Summary418333 +Node: Patterns and Actions420906 +Node: Pattern Overview422026 +Node: Regexp Patterns423703 +Node: Expression Patterns424245 +Node: Ranges428026 +Node: BEGIN/END431134 +Node: Using BEGIN/END431895 +Ref: Using BEGIN/END-Footnote-1434649 +Node: I/O And BEGIN/END434755 +Node: BEGINFILE/ENDFILE437068 +Node: Empty440299 +Node: Using Shell Variables440616 +Node: Action Overview442890 +Node: Statements445215 +Node: If Statement447063 +Node: While Statement448558 +Node: Do Statement450586 +Node: For Statement451734 +Node: Switch Statement454905 +Node: Break Statement457346 +Node: Continue Statement459438 +Node: Next Statement461265 +Node: Nextfile Statement463648 +Node: Exit Statement466337 +Node: Built-in Variables468740 +Node: User-modified469873 +Node: Auto-set477640 +Ref: Auto-set-Footnote-1494447 +Ref: Auto-set-Footnote-2494653 +Node: ARGC and ARGV494709 +Node: Pattern Action Summary498922 +Node: Arrays501352 +Node: Array Basics502681 +Node: Array Intro503525 +Ref: figure-array-elements505500 +Ref: Array Intro-Footnote-1508204 +Node: Reference to Elements508332 +Node: Assigning Elements510796 +Node: Array Example511287 +Node: Scanning an Array513046 +Node: Controlling Scanning516068 +Ref: Controlling Scanning-Footnote-1522524 +Node: Numeric Array Subscripts522840 +Node: Uninitialized Subscripts525024 +Node: Delete526643 +Ref: Delete-Footnote-1529395 +Node: Multidimensional529452 +Node: Multiscanning532547 +Node: Arrays of Arrays534138 +Node: Arrays Summary538906 +Node: Functions540999 +Node: Built-in542037 +Node: Calling Built-in543190 +Node: Boolean Functions545186 +Node: Numeric Functions545740 +Ref: Numeric Functions-Footnote-1549767 +Ref: Numeric Functions-Footnote-2550415 +Ref: Numeric Functions-Footnote-3550463 +Node: String Functions550735 +Ref: String Functions-Footnote-1574876 +Ref: String Functions-Footnote-2575004 +Ref: String Functions-Footnote-3575252 +Node: Gory Details575339 +Ref: table-sub-escapes577130 +Ref: table-sub-proposed578649 +Ref: table-posix-sub580012 +Ref: table-gensub-escapes581553 +Ref: Gory Details-Footnote-1582376 +Node: I/O Functions582530 +Ref: table-system-return-values588984 +Ref: I/O Functions-Footnote-1591064 +Ref: I/O Functions-Footnote-2591212 +Node: Time Functions591332 +Ref: Time Functions-Footnote-1602003 +Ref: Time Functions-Footnote-2602071 +Ref: Time Functions-Footnote-3602229 +Ref: Time Functions-Footnote-4602340 +Ref: Time Functions-Footnote-5602452 +Ref: Time Functions-Footnote-6602679 +Node: Bitwise Functions602945 +Ref: table-bitwise-ops603539 +Ref: Bitwise Functions-Footnote-1609602 +Ref: Bitwise Functions-Footnote-2609775 +Node: Type Functions609966 +Node: I18N Functions612920 +Node: User-defined614571 +Node: Definition Syntax615383 +Ref: Definition Syntax-Footnote-1621077 +Node: Function Example621148 +Ref: Function Example-Footnote-1624070 +Node: Function Calling624092 +Node: Calling A Function624680 +Node: Variable Scope625638 +Node: Pass By Value/Reference628632 +Node: Function Caveats631276 +Ref: Function Caveats-Footnote-1633323 +Node: Return Statement633443 +Node: Dynamic Typing636422 +Node: Indirect Calls637352 +Ref: Indirect Calls-Footnote-1647607 +Node: Functions Summary647735 +Node: Library Functions650440 +Ref: Library Functions-Footnote-1654047 +Ref: Library Functions-Footnote-2654190 +Node: Library Names654361 +Ref: Library Names-Footnote-1658028 +Ref: Library Names-Footnote-2658251 +Node: General Functions658337 +Node: Strtonum Function659519 +Node: Assert Function662541 +Node: Round Function665867 +Node: Cliff Random Function667407 +Node: Ordinal Functions668423 +Ref: Ordinal Functions-Footnote-1671486 +Ref: Ordinal Functions-Footnote-2671738 +Node: Join Function671948 +Ref: Join Function-Footnote-1673718 +Node: Getlocaltime Function673918 +Node: Readfile Function677660 +Node: Shell Quoting679637 +Node: Isnumeric Function681065 +Node: Data File Management682046 +Node: Filetrans Function682678 +Node: Rewind Function686774 +Node: File Checking688683 +Ref: File Checking-Footnote-1690017 +Node: Empty Files690218 +Node: Ignoring Assigns692197 +Node: Getopt Function693747 +Ref: Getopt Function-Footnote-1708970 +Node: Passwd Functions709170 +Ref: Passwd Functions-Footnote-1718009 +Node: Group Functions718097 +Ref: Group Functions-Footnote-1725995 +Node: Walking Arrays726202 +Node: Library Functions Summary729210 +Node: Library Exercises730616 +Node: Sample Programs731081 +Node: Running Examples731851 +Node: Clones732579 +Node: Cut Program733803 +Node: Egrep Program743943 +Node: Id Program752944 +Node: Split Program762891 +Ref: Split Program-Footnote-1772784 +Node: Tee Program772957 +Node: Uniq Program775747 +Node: Wc Program783335 +Node: Bytes vs. Characters783722 +Node: Using extensions785270 +Node: wc program786024 +Node: Miscellaneous Programs790889 +Node: Dupword Program792102 +Node: Alarm Program794132 +Node: Translate Program798987 +Ref: Translate Program-Footnote-1803552 +Node: Labels Program803822 +Ref: Labels Program-Footnote-1807173 +Node: Word Sorting807257 +Node: History Sorting811329 +Node: Extract Program813554 +Node: Simple Sed821608 +Node: Igawk Program824682 +Ref: Igawk Program-Footnote-1839013 +Ref: Igawk Program-Footnote-2839215 +Ref: Igawk Program-Footnote-3839337 +Node: Anagram Program839452 +Node: Signature Program842514 +Node: Programs Summary843761 +Node: Programs Exercises844975 +Ref: Programs Exercises-Footnote-1849105 +Node: Advanced Features849191 +Node: Nondecimal Data851322 +Node: Boolean Typed Values852920 +Node: Array Sorting854801 +Node: Controlling Array Traversal855506 +Ref: Controlling Array Traversal-Footnote-1863874 +Node: Array Sorting Functions863992 +Ref: Array Sorting Functions-Footnote-1869083 +Node: Two-way I/O869279 +Ref: Two-way I/O-Footnote-1877005 +Ref: Two-way I/O-Footnote-2877192 +Node: TCP/IP Networking877274 +Node: Profiling880392 +Node: Extension Philosophy889701 +Node: Advanced Features Summary891180 +Node: Internationalization893195 +Node: I18N and L10N894869 +Node: Explaining gettext895556 +Ref: Explaining gettext-Footnote-1901448 +Ref: Explaining gettext-Footnote-2901633 +Node: Programmer i18n901798 +Ref: Programmer i18n-Footnote-1906747 +Node: Translator i18n906796 +Node: String Extraction907590 +Ref: String Extraction-Footnote-1908722 +Node: Printf Ordering908808 +Ref: Printf Ordering-Footnote-1911594 +Node: I18N Portability911658 +Ref: I18N Portability-Footnote-1914114 +Node: I18N Example914177 +Ref: I18N Example-Footnote-1917452 +Ref: I18N Example-Footnote-2917525 +Node: Gawk I18N917634 +Node: I18N Summary918283 +Node: Debugger919624 +Node: Debugging920624 +Node: Debugging Concepts921065 +Node: Debugging Terms922874 +Node: Awk Debugging925449 +Ref: Awk Debugging-Footnote-1926394 +Node: Sample Debugging Session926526 +Node: Debugger Invocation927060 +Node: Finding The Bug928446 +Node: List of Debugger Commands934920 +Node: Breakpoint Control936253 +Node: Debugger Execution Control939947 +Node: Viewing And Changing Data943309 +Node: Execution Stack946850 +Node: Debugger Info948487 +Node: Miscellaneous Debugger Commands952558 +Node: Readline Support957620 +Node: Limitations958516 +Node: Debugging Summary961070 +Node: Namespaces962349 +Node: Global Namespace963460 +Node: Qualified Names964858 +Node: Default Namespace965857 +Node: Changing The Namespace966598 +Node: Naming Rules968212 +Node: Internal Name Management970060 +Node: Namespace Example971102 +Node: Namespace And Features973664 +Node: Namespace Summary975099 +Node: Arbitrary Precision Arithmetic976576 +Node: Computer Arithmetic978063 +Ref: table-numeric-ranges981829 +Ref: table-floating-point-ranges982322 +Ref: Computer Arithmetic-Footnote-1982980 +Node: Math Definitions983037 +Ref: table-ieee-formats986013 +Node: MPFR features986580 +Node: FP Math Caution988298 +Ref: FP Math Caution-Footnote-1989370 +Node: Inexactness of computations989739 +Node: Inexact representation990770 +Node: Comparing FP Values992130 +Node: Errors accumulate993371 +Node: Strange values994827 +Ref: Strange values-Footnote-1997415 +Node: Getting Accuracy997520 +Node: Try To Round1000230 +Node: Setting precision1001129 +Ref: table-predefined-precision-strings1001826 +Node: Setting the rounding mode1003656 +Ref: table-gawk-rounding-modes1004030 +Ref: Setting the rounding mode-Footnote-11007961 +Node: Arbitrary Precision Integers1008140 +Ref: Arbitrary Precision Integers-Footnote-11011315 +Node: Checking for MPFR1011464 +Node: POSIX Floating Point Problems1012938 +Ref: POSIX Floating Point Problems-Footnote-11017223 +Node: Floating point summary1017261 +Node: Dynamic Extensions1019451 +Node: Extension Intro1021004 +Node: Plugin License1022270 +Node: Extension Mechanism Outline1023067 +Ref: figure-load-extension1023506 +Ref: figure-register-new-function1025071 +Ref: figure-call-new-function1026163 +Node: Extension API Description1028225 +Node: Extension API Functions Introduction1029938 +Ref: table-api-std-headers1031774 +Node: General Data Types1036023 +Ref: General Data Types-Footnote-11044729 +Node: Memory Allocation Functions1045028 +Ref: Memory Allocation Functions-Footnote-11049529 +Node: Constructor Functions1049628 +Node: API Ownership of MPFR and GMP Values1053281 +Node: Registration Functions1054594 +Node: Extension Functions1055294 +Node: Exit Callback Functions1060616 +Node: Extension Version String1061866 +Node: Input Parsers1062529 +Node: Output Wrappers1075250 +Node: Two-way processors1079762 +Node: Printing Messages1082027 +Ref: Printing Messages-Footnote-11083198 +Node: Updating ERRNO1083351 +Node: Requesting Values1084090 +Ref: table-value-types-returned1084827 +Node: Accessing Parameters1085935 +Node: Symbol Table Access1087172 +Node: Symbol table by name1087684 +Ref: Symbol table by name-Footnote-11090708 +Node: Symbol table by cookie1090836 +Ref: Symbol table by cookie-Footnote-11095021 +Node: Cached values1095085 +Ref: Cached values-Footnote-11098621 +Node: Array Manipulation1098774 +Ref: Array Manipulation-Footnote-11099865 +Node: Array Data Types1099902 +Ref: Array Data Types-Footnote-11102560 +Node: Array Functions1102652 +Node: Flattening Arrays1107150 +Node: Creating Arrays1114126 +Node: Redirection API1118893 +Node: Extension API Variables1121726 +Node: Extension Versioning1122437 +Ref: gawk-api-version1122866 +Node: Extension GMP/MPFR Versioning1124597 +Node: Extension API Informational Variables1126225 +Node: Extension API Boilerplate1127298 +Node: Changes from API V11131272 +Node: Finding Extensions1132844 +Node: Extension Example1133403 +Node: Internal File Description1134201 +Node: Internal File Ops1138281 +Ref: Internal File Ops-Footnote-11149631 +Node: Using Internal File Ops1149771 +Ref: Using Internal File Ops-Footnote-11152154 +Node: Extension Samples1152428 +Node: Extension Sample File Functions1153957 +Node: Extension Sample Fnmatch1161606 +Node: Extension Sample Fork1163093 +Node: Extension Sample Inplace1164311 +Node: Extension Sample Ord1167937 +Node: Extension Sample Readdir1168773 +Ref: table-readdir-file-types1169662 +Node: Extension Sample Revout1170729 +Node: Extension Sample Rev2way1171318 +Node: Extension Sample Read write array1172058 +Node: Extension Sample Readfile1174000 +Node: Extension Sample Time1175095 +Node: Extension Sample API Tests1176847 +Node: gawkextlib1177339 +Node: Extension summary1180257 +Node: Extension Exercises1183959 +Node: Language History1185201 +Node: V7/SVR3.11186857 +Node: SVR41189009 +Node: POSIX1190443 +Node: BTL1191824 +Node: POSIX/GNU1192553 +Node: Feature History1198331 +Node: Common Extensions1215506 +Node: Ranges and Locales1216789 +Ref: Ranges and Locales-Footnote-11221405 +Ref: Ranges and Locales-Footnote-21221432 +Ref: Ranges and Locales-Footnote-31221667 +Node: Contributors1221890 +Node: History summary1227887 +Node: Installation1229267 +Node: Gawk Distribution1230211 +Node: Getting1230695 +Node: Extracting1231658 +Node: Distribution contents1233296 +Node: Unix Installation1239776 +Node: Quick Installation1240458 +Node: Compiling with MPFR1242939 +Node: Shell Startup Files1243631 +Node: Additional Configuration Options1244720 +Node: Configuration Philosophy1247035 +Node: Non-Unix Installation1249404 +Node: PC Installation1249864 +Node: PC Binary Installation1250702 +Node: PC Compiling1251137 +Node: PC Using1252254 +Node: Cygwin1255807 +Node: MSYS1257031 +Node: VMS Installation1257633 +Node: VMS Compilation1258424 +Ref: VMS Compilation-Footnote-11259653 +Node: VMS Dynamic Extensions1259711 +Node: VMS Installation Details1261396 +Node: VMS Running1263649 +Node: VMS GNV1267928 +Node: VMS Old Gawk1268663 +Node: Bugs1269134 +Node: Bug address1269883 +Node: Usenet1272865 +Node: Performance bugs1273874 +Node: Maintainers1276731 +Node: Other Versions1277926 +Node: Installation summary1285791 +Node: Notes1287000 +Node: Compatibility Mode1287794 +Node: Additions1288576 +Node: Accessing The Source1289501 +Node: Adding Code1290938 +Node: New Ports1297157 +Node: Derived Files1301532 +Ref: Derived Files-Footnote-11307192 +Ref: Derived Files-Footnote-21307227 +Ref: Derived Files-Footnote-31307825 +Node: Future Extensions1307939 +Node: Implementation Limitations1308597 +Node: Extension Design1309807 +Node: Old Extension Problems1310951 +Ref: Old Extension Problems-Footnote-11312469 +Node: Extension New Mechanism Goals1312526 +Ref: Extension New Mechanism Goals-Footnote-11315890 +Node: Extension Other Design Decisions1316079 +Node: Extension Future Growth1318192 +Node: Notes summary1318798 +Node: Basic Concepts1319956 +Node: Basic High Level1320637 +Ref: figure-general-flow1320919 +Ref: figure-process-flow1321604 +Ref: Basic High Level-Footnote-11324905 +Node: Basic Data Typing1325090 +Node: Glossary1328418 +Node: Copying1360305 +Node: GNU Free Documentation License1397848 +Node: Index1422968 End Tag Table |