diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-08-16 22:09:29 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-08-16 22:09:29 +0300 |
commit | 79b577d28d0921221726d881229b0364ef36eace (patch) | |
tree | 1d1eb3978963cd5b512d76d064f032fef5e195e2 | |
parent | 1a9579b6c5722277b34802b7665f340b095a2e98 (diff) | |
parent | 44f0c70e04a1beef988cde4950aabe29139e789a (diff) | |
download | egawk-79b577d28d0921221726d881229b0364ef36eace.tar.gz egawk-79b577d28d0921221726d881229b0364ef36eace.tar.bz2 egawk-79b577d28d0921221726d881229b0364ef36eace.zip |
Merge branch 'gawk-4.1-stable'
-rw-r--r-- | doc/ChangeLog | 4 | ||||
-rw-r--r-- | doc/gawk.info | 954 | ||||
-rw-r--r-- | doc/gawk.texi | 24 | ||||
-rw-r--r-- | doc/gawktexi.in | 22 |
4 files changed, 518 insertions, 486 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog index e44e28b8..53d13a66 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2014-08-16 Arnold D. Robbins <arnold@skeeve.com> + + * gawktexi.in: Continuing on reviewer comments. + 2014-08-15 Arnold D. Robbins <arnold@skeeve.com> * gawktexi.in: Continuing on reviewer comments. diff --git a/doc/gawk.info b/doc/gawk.info index 878b1584..038e9a83 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -4810,7 +4810,8 @@ argument to `-F' is `t', then `FS' is set to the TAB character. If you type `-F\t' at the shell, without any quotes, the `\' gets deleted, so `awk' figures that you really want your fields to be separated with TABs and not `t's. Use `-v FS="t"' or `-F"[t]"' on the command line if -you really do want to separate your fields with `t's. +you really do want to separate your fields with `t's. Use `-F '\t'' +when not in compatibility mode to specify that TABs separate fields. As an example, let's use an `awk' program file called `edu.awk' that contains the pattern `/edu/' and the action `print $1': @@ -4930,8 +4931,8 @@ which usually prints: root -on an incorrect implementation of `awk', while `gawk' prints something -like: +on an incorrect implementation of `awk', while `gawk' prints the full +first line of the file, something like: root:nSijPlPhZZwgE:0:0:Root:/: @@ -5011,7 +5012,7 @@ calculated idle time: BEGIN { FIELDWIDTHS = "9 6 10 6 7 7 35" } NR > 2 { idle = $4 - sub(/^ */, "", idle) # strip leading spaces + sub(/^ +/, "", idle) # strip leading spaces if (idle == "") idle = 0 if (idle ~ /:/) { @@ -5142,8 +5143,10 @@ would be to remove the quotes when they occur, with something like this: As with `FS', the `IGNORECASE' variable (*note User-modified::) affects field splitting with `FPAT'. - Similar to `FIELDWIDTHS', the value of `PROCINFO["FS"]' will be -`"FPAT"' if content-based field splitting is being used. + Assigning a value to `FPAT' overrides field splitting with `FS' and +with `FIELDWIDTHS'. Similar to `FIELDWIDTHS', the value of +`PROCINFO["FS"]' will be `"FPAT"' if content-based field splitting is +being used. NOTE: Some programs export CSV data that contains embedded newlines between the double quotes. `gawk' provides no way to @@ -5161,6 +5164,11 @@ changed the first `+' to `*') allows fields to be empty: Finally, the `patsplit()' function makes the same functionality available for splitting regular strings (*note String Functions::). + To recap, `gawk' provides three independent methods to split input +records into fields. `gawk' uses whichever mechanism was last chosen +based on which of the three variables--`FS', `FIELDWIDTHS', and +`FPAT'--was last assigned to. + ---------- Footnotes ---------- (1) At least, we don't know of one. @@ -6748,8 +6756,8 @@ to rename the files. It then sends the list to the shell for execution. File: gawk.info, Node: Special Files, Next: Close Files And Pipes, Prev: Redirection, Up: Printing -5.7 Special File Name in `gawk' -=============================== +5.7 Special File Names in `gawk' +================================ `gawk' provides a number of special file names that it interprets internally. These file names provide access to standard file @@ -8187,7 +8195,7 @@ operands, according to the following symmetric matrix: user input--should be treated as numeric, even though it is actually made of characters and is therefore also a string. Thus, for example, the string constant `" +3.14"', when it appears in program source code, -is a string--even though it looks numeric--and is _never_ treated as +is a string--even though it looks numeric--and is _never_ treated as a number for comparison purposes. In short, when one operand is a "pure" string, such as a string @@ -21621,7 +21629,7 @@ File: gawk.info, Node: FP Math Caution, Next: Arbitrary Precision Integers, P 15.4 Floating Point Arithmetic: Caveat Emptor! ============================================== - Math class is tough! -- Late 1980's Barbie + Math class is tough! -- Teen Talk Barbie (July, 1992) This minor node provides a high level overview of the issues involved when doing lots of floating-point arithmetic.(1) The @@ -22206,7 +22214,7 @@ File: gawk.info, Node: Floating point summary, Prev: POSIX Floating Point Prob floating-point values. The default for `awk' is to use double-precision floating-point values. - * In the 1980's, Barbie mistakenly said "Math class is tough!" + * In the early 1990's, Barbie mistakenly said "Math class is tough!" While math isn't tough, floating-point arithmetic isn't the same as pencil and paper math, and care must be taken: @@ -33420,7 +33428,7 @@ Index * Robbins, Arnold <6>: Passwd Functions. (line 90) * Robbins, Arnold <7>: Getline/Pipe. (line 39) * Robbins, Arnold: Command Line Field Separator. - (line 73) + (line 74) * Robbins, Bill: Getline/Pipe. (line 39) * Robbins, Harry: Acknowledgments. (line 92) * Robbins, Jean: Acknowledgments. (line 92) @@ -33835,7 +33843,7 @@ Index * Unix awk, close() function and: Close Files And Pipes. (line 131) * Unix awk, password files, field separators and: Command Line Field Separator. - (line 64) + (line 65) * Unix, awk scripts and: Executable Scripts. (line 6) * UNIXROOT variable, on OS/2 systems: PC Using. (line 16) * unsigned integers: Computer Arithmetic. (line 41) @@ -34061,465 +34069,465 @@ Node: Default Field Splitting209968 Node: Regexp Field Splitting211085 Node: Single Character Fields214426 Node: Command Line Field Separator215485 -Node: Full Line Fields218827 -Ref: Full Line Fields-Footnote-1219335 -Node: Field Splitting Summary219381 -Ref: Field Splitting Summary-Footnote-1222480 -Node: Constant Size222581 -Node: Splitting By Content227188 -Ref: Splitting By Content-Footnote-1230938 -Node: Multiple Line230978 -Ref: Multiple Line-Footnote-1236834 -Node: Getline237013 -Node: Plain Getline239229 -Node: Getline/Variable241324 -Node: Getline/File242471 -Node: Getline/Variable/File243855 -Ref: Getline/Variable/File-Footnote-1245454 -Node: Getline/Pipe245541 -Node: Getline/Variable/Pipe248240 -Node: Getline/Coprocess249347 -Node: Getline/Variable/Coprocess250599 -Node: Getline Notes251336 -Node: Getline Summary254140 -Ref: table-getline-variants254548 -Node: Read Timeout255460 -Ref: Read Timeout-Footnote-1259287 -Node: Command-line directories259345 -Node: Input Summary260249 -Node: Input Exercises263386 -Node: Printing264119 -Node: Print265841 -Node: Print Examples267182 -Node: Output Separators269961 -Node: OFMT271977 -Node: Printf273335 -Node: Basic Printf274241 -Node: Control Letters275780 -Node: Format Modifiers279771 -Node: Printf Examples285798 -Node: Redirection288262 -Node: Special Files295234 -Node: Special FD295765 -Ref: Special FD-Footnote-1299362 -Node: Special Network299436 -Node: Special Caveats300286 -Node: Close Files And Pipes301082 -Ref: Close Files And Pipes-Footnote-1308243 -Ref: Close Files And Pipes-Footnote-2308391 -Node: Output Summary308541 -Node: Output exercises309538 -Node: Expressions310218 -Node: Values311403 -Node: Constants312079 -Node: Scalar Constants312759 -Ref: Scalar Constants-Footnote-1313618 -Node: Nondecimal-numbers313868 -Node: Regexp Constants316868 -Node: Using Constant Regexps317343 -Node: Variables320415 -Node: Using Variables321070 -Node: Assignment Options322794 -Node: Conversion324669 -Node: Strings And Numbers325193 -Ref: Strings And Numbers-Footnote-1328255 -Node: Locale influences conversions328364 -Ref: table-locale-affects331081 -Node: All Operators331669 -Node: Arithmetic Ops332299 -Node: Concatenation334804 -Ref: Concatenation-Footnote-1337623 -Node: Assignment Ops337743 -Ref: table-assign-ops342726 -Node: Increment Ops344043 -Node: Truth Values and Conditions347481 -Node: Truth Values348564 -Node: Typing and Comparison349613 -Node: Variable Typing350406 -Node: Comparison Operators354056 -Ref: table-relational-ops354466 -Node: POSIX String Comparison358016 -Ref: POSIX String Comparison-Footnote-1359100 -Node: Boolean Ops359238 -Ref: Boolean Ops-Footnote-1363308 -Node: Conditional Exp363399 -Node: Function Calls365126 -Node: Precedence369006 -Node: Locales372675 -Node: Expressions Summary374306 -Node: Patterns and Actions376847 -Node: Pattern Overview377963 -Node: Regexp Patterns379640 -Node: Expression Patterns380183 -Node: Ranges383964 -Node: BEGIN/END387070 -Node: Using BEGIN/END387832 -Ref: Using BEGIN/END-Footnote-1390568 -Node: I/O And BEGIN/END390674 -Node: BEGINFILE/ENDFILE392959 -Node: Empty395890 -Node: Using Shell Variables396207 -Node: Action Overview398490 -Node: Statements400817 -Node: If Statement402665 -Node: While Statement404163 -Node: Do Statement406207 -Node: For Statement407363 -Node: Switch Statement410515 -Node: Break Statement412618 -Node: Continue Statement414673 -Node: Next Statement416466 -Node: Nextfile Statement418856 -Node: Exit Statement421511 -Node: Built-in Variables423915 -Node: User-modified425042 -Ref: User-modified-Footnote-1432731 -Node: Auto-set432793 -Ref: Auto-set-Footnote-1445712 -Ref: Auto-set-Footnote-2445917 -Node: ARGC and ARGV445973 -Node: Pattern Action Summary449827 -Node: Arrays452050 -Node: Array Basics453599 -Node: Array Intro454425 -Ref: figure-array-elements456398 -Node: Reference to Elements458805 -Node: Assigning Elements461078 -Node: Array Example461569 -Node: Scanning an Array463301 -Node: Controlling Scanning466316 -Ref: Controlling Scanning-Footnote-1471489 -Node: Delete471805 -Ref: Delete-Footnote-1474570 -Node: Numeric Array Subscripts474627 -Node: Uninitialized Subscripts476810 -Node: Multidimensional478435 -Node: Multiscanning481528 -Node: Arrays of Arrays483117 -Node: Arrays Summary487780 -Node: Functions489885 -Node: Built-in490758 -Node: Calling Built-in491836 -Node: Numeric Functions493824 -Ref: Numeric Functions-Footnote-1498568 -Ref: Numeric Functions-Footnote-2498925 -Ref: Numeric Functions-Footnote-3498973 -Node: String Functions499242 -Ref: String Functions-Footnote-1522253 -Ref: String Functions-Footnote-2522382 -Ref: String Functions-Footnote-3522630 -Node: Gory Details522717 -Ref: table-sub-escapes524504 -Ref: table-sub-proposed526024 -Ref: table-posix-sub527388 -Ref: table-gensub-escapes528928 -Ref: Gory Details-Footnote-1530104 -Node: I/O Functions530255 -Ref: I/O Functions-Footnote-1537378 -Node: Time Functions537525 -Ref: Time Functions-Footnote-1547989 -Ref: Time Functions-Footnote-2548057 -Ref: Time Functions-Footnote-3548215 -Ref: Time Functions-Footnote-4548326 -Ref: Time Functions-Footnote-5548438 -Ref: Time Functions-Footnote-6548665 -Node: Bitwise Functions548931 -Ref: table-bitwise-ops549493 -Ref: Bitwise Functions-Footnote-1553738 -Node: Type Functions553922 -Node: I18N Functions555064 -Node: User-defined556709 -Node: Definition Syntax557513 -Ref: Definition Syntax-Footnote-1562692 -Node: Function Example562761 -Ref: Function Example-Footnote-1565325 -Node: Function Caveats565347 -Node: Calling A Function565865 -Node: Variable Scope566820 -Node: Pass By Value/Reference569808 -Node: Return Statement573318 -Node: Dynamic Typing576302 -Node: Indirect Calls577231 -Node: Functions Summary586944 -Node: Library Functions589483 -Ref: Library Functions-Footnote-1593101 -Ref: Library Functions-Footnote-2593244 -Node: Library Names593415 -Ref: Library Names-Footnote-1596888 -Ref: Library Names-Footnote-2597108 -Node: General Functions597194 -Node: Strtonum Function598222 -Node: Assert Function601002 -Node: Round Function604328 -Node: Cliff Random Function605869 -Node: Ordinal Functions606885 -Ref: Ordinal Functions-Footnote-1609962 -Ref: Ordinal Functions-Footnote-2610214 -Node: Join Function610425 -Ref: Join Function-Footnote-1612196 -Node: Getlocaltime Function612396 -Node: Readfile Function616132 -Node: Data File Management617971 -Node: Filetrans Function618603 -Node: Rewind Function622672 -Node: File Checking624230 -Ref: File Checking-Footnote-1625362 -Node: Empty Files625563 -Node: Ignoring Assigns627542 -Node: Getopt Function629096 -Ref: Getopt Function-Footnote-1640399 -Node: Passwd Functions640602 -Ref: Passwd Functions-Footnote-1649581 -Node: Group Functions649669 -Ref: Group Functions-Footnote-1657610 -Node: Walking Arrays657823 -Node: Library Functions Summary659426 -Node: Library exercises660814 -Node: Sample Programs662094 -Node: Running Examples662864 -Node: Clones663592 -Node: Cut Program664816 -Node: Egrep Program674684 -Ref: Egrep Program-Footnote-1682655 -Node: Id Program682765 -Node: Split Program686429 -Ref: Split Program-Footnote-1689967 -Node: Tee Program690095 -Node: Uniq Program692902 -Node: Wc Program700332 -Ref: Wc Program-Footnote-1704597 -Node: Miscellaneous Programs704689 -Node: Dupword Program705902 -Node: Alarm Program707933 -Node: Translate Program712747 -Ref: Translate Program-Footnote-1717138 -Ref: Translate Program-Footnote-2717408 -Node: Labels Program717542 -Ref: Labels Program-Footnote-1720913 -Node: Word Sorting720997 -Node: History Sorting725040 -Node: Extract Program726876 -Node: Simple Sed734412 -Node: Igawk Program737474 -Ref: Igawk Program-Footnote-1751785 -Ref: Igawk Program-Footnote-2751986 -Node: Anagram Program752124 -Node: Signature Program755192 -Node: Programs Summary756439 -Node: Programs Exercises757654 -Node: Advanced Features761305 -Node: Nondecimal Data763253 -Node: Array Sorting764830 -Node: Controlling Array Traversal765527 -Node: Array Sorting Functions773807 -Ref: Array Sorting Functions-Footnote-1777714 -Node: Two-way I/O777908 -Ref: Two-way I/O-Footnote-1782852 -Ref: Two-way I/O-Footnote-2783031 -Node: TCP/IP Networking783113 -Node: Profiling785958 -Node: Advanced Features Summary793509 -Node: Internationalization795373 -Node: I18N and L10N796853 -Node: Explaining gettext797539 -Ref: Explaining gettext-Footnote-1802679 -Ref: Explaining gettext-Footnote-2802863 -Node: Programmer i18n803028 -Node: Translator i18n807253 -Node: String Extraction808047 -Ref: String Extraction-Footnote-1809008 -Node: Printf Ordering809094 -Ref: Printf Ordering-Footnote-1811876 -Node: I18N Portability811940 -Ref: I18N Portability-Footnote-1814389 -Node: I18N Example814452 -Ref: I18N Example-Footnote-1817174 -Node: Gawk I18N817246 -Node: I18N Summary817884 -Node: Debugger819223 -Node: Debugging820245 -Node: Debugging Concepts820686 -Node: Debugging Terms822542 -Node: Awk Debugging825139 -Node: Sample Debugging Session826031 -Node: Debugger Invocation826551 -Node: Finding The Bug827884 -Node: List of Debugger Commands834366 -Node: Breakpoint Control835698 -Node: Debugger Execution Control839362 -Node: Viewing And Changing Data842722 -Node: Execution Stack846080 -Node: Debugger Info847593 -Node: Miscellaneous Debugger Commands851587 -Node: Readline Support856771 -Node: Limitations857663 -Node: Debugging Summary859937 -Node: Arbitrary Precision Arithmetic861101 -Node: Computer Arithmetic862588 -Ref: Computer Arithmetic-Footnote-1866975 -Node: Math Definitions867032 -Ref: table-ieee-formats870321 -Ref: Math Definitions-Footnote-1870861 -Node: MPFR features870964 -Node: FP Math Caution872606 -Ref: FP Math Caution-Footnote-1873647 -Node: Inexactness of computations874016 -Node: Inexact representation874964 -Node: Comparing FP Values876319 -Node: Errors accumulate877283 -Node: Getting Accuracy878716 -Node: Try To Round881375 -Node: Setting precision882274 -Ref: table-predefined-precision-strings882956 -Node: Setting the rounding mode884749 -Ref: table-gawk-rounding-modes885113 -Ref: Setting the rounding mode-Footnote-1888567 -Node: Arbitrary Precision Integers888746 -Ref: Arbitrary Precision Integers-Footnote-1892541 -Node: POSIX Floating Point Problems892690 -Ref: POSIX Floating Point Problems-Footnote-1896566 -Node: Floating point summary896604 -Node: Dynamic Extensions898821 -Node: Extension Intro900373 -Node: Plugin License901638 -Node: Extension Mechanism Outline902323 -Ref: figure-load-extension902747 -Ref: figure-load-new-function904232 -Ref: figure-call-new-function905234 -Node: Extension API Description907218 -Node: Extension API Functions Introduction908668 -Node: General Data Types913533 -Ref: General Data Types-Footnote-1919226 -Node: Requesting Values919525 -Ref: table-value-types-returned920262 -Node: Memory Allocation Functions921220 -Ref: Memory Allocation Functions-Footnote-1923967 -Node: Constructor Functions924063 -Node: Registration Functions925821 -Node: Extension Functions926506 -Node: Exit Callback Functions928808 -Node: Extension Version String930057 -Node: Input Parsers930707 -Node: Output Wrappers940521 -Node: Two-way processors945037 -Node: Printing Messages947241 -Ref: Printing Messages-Footnote-1948318 -Node: Updating `ERRNO'948470 -Node: Accessing Parameters949209 -Node: Symbol Table Access950439 -Node: Symbol table by name950953 -Node: Symbol table by cookie952929 -Ref: Symbol table by cookie-Footnote-1957062 -Node: Cached values957125 -Ref: Cached values-Footnote-1960629 -Node: Array Manipulation960720 -Ref: Array Manipulation-Footnote-1961818 -Node: Array Data Types961857 -Ref: Array Data Types-Footnote-1964560 -Node: Array Functions964652 -Node: Flattening Arrays968526 -Node: Creating Arrays975378 -Node: Extension API Variables980109 -Node: Extension Versioning980745 -Node: Extension API Informational Variables982646 -Node: Extension API Boilerplate983732 -Node: Finding Extensions987536 -Node: Extension Example988096 -Node: Internal File Description988826 -Node: Internal File Ops992917 -Ref: Internal File Ops-Footnote-11004349 -Node: Using Internal File Ops1004489 -Ref: Using Internal File Ops-Footnote-11006836 -Node: Extension Samples1007104 -Node: Extension Sample File Functions1008628 -Node: Extension Sample Fnmatch1016196 -Node: Extension Sample Fork1017678 -Node: Extension Sample Inplace1018891 -Node: Extension Sample Ord1020566 -Node: Extension Sample Readdir1021402 -Ref: table-readdir-file-types1022258 -Node: Extension Sample Revout1023057 -Node: Extension Sample Rev2way1023648 -Node: Extension Sample Read write array1024389 -Node: Extension Sample Readfile1026268 -Node: Extension Sample API Tests1027368 -Node: Extension Sample Time1027893 -Node: gawkextlib1029208 -Node: Extension summary1032021 -Node: Extension Exercises1035714 -Node: Language History1036436 -Node: V7/SVR3.11038079 -Node: SVR41040399 -Node: POSIX1041841 -Node: BTL1043227 -Node: POSIX/GNU1043961 -Node: Feature History1049704 -Node: Common Extensions1062834 -Node: Ranges and Locales1064146 -Ref: Ranges and Locales-Footnote-11068763 -Ref: Ranges and Locales-Footnote-21068790 -Ref: Ranges and Locales-Footnote-31069024 -Node: Contributors1069245 -Node: History summary1074670 -Node: Installation1076039 -Node: Gawk Distribution1076990 -Node: Getting1077474 -Node: Extracting1078298 -Node: Distribution contents1079940 -Node: Unix Installation1085710 -Node: Quick Installation1086327 -Node: Additional Configuration Options1088769 -Node: Configuration Philosophy1090507 -Node: Non-Unix Installation1092858 -Node: PC Installation1093316 -Node: PC Binary Installation1094627 -Node: PC Compiling1096475 -Ref: PC Compiling-Footnote-11099474 -Node: PC Testing1099579 -Node: PC Using1100755 -Node: Cygwin1104913 -Node: MSYS1105722 -Node: VMS Installation1106236 -Node: VMS Compilation1107032 -Ref: VMS Compilation-Footnote-11108254 -Node: VMS Dynamic Extensions1108312 -Node: VMS Installation Details1109685 -Node: VMS Running1111937 -Node: VMS GNV1114771 -Node: VMS Old Gawk1115494 -Node: Bugs1115964 -Node: Other Versions1119968 -Node: Installation summary1126223 -Node: Notes1127279 -Node: Compatibility Mode1128144 -Node: Additions1128926 -Node: Accessing The Source1129851 -Node: Adding Code1131287 -Node: New Ports1137465 -Node: Derived Files1141946 -Ref: Derived Files-Footnote-11147027 -Ref: Derived Files-Footnote-21147061 -Ref: Derived Files-Footnote-31147657 -Node: Future Extensions1147771 -Node: Implementation Limitations1148377 -Node: Extension Design1149625 -Node: Old Extension Problems1150779 -Ref: Old Extension Problems-Footnote-11152296 -Node: Extension New Mechanism Goals1152353 -Ref: Extension New Mechanism Goals-Footnote-11155713 -Node: Extension Other Design Decisions1155902 -Node: Extension Future Growth1158008 -Node: Old Extension Mechanism1158844 -Node: Notes summary1160606 -Node: Basic Concepts1161792 -Node: Basic High Level1162473 -Ref: figure-general-flow1162745 -Ref: figure-process-flow1163344 -Ref: Basic High Level-Footnote-11166573 -Node: Basic Data Typing1166758 -Node: Glossary1170086 -Node: Copying1195238 -Node: GNU Free Documentation License1232794 -Node: Index1257930 +Node: Full Line Fields218911 +Ref: Full Line Fields-Footnote-1219419 +Node: Field Splitting Summary219465 +Ref: Field Splitting Summary-Footnote-1222597 +Node: Constant Size222698 +Node: Splitting By Content227304 +Ref: Splitting By Content-Footnote-1231377 +Node: Multiple Line231417 +Ref: Multiple Line-Footnote-1237273 +Node: Getline237452 +Node: Plain Getline239668 +Node: Getline/Variable241763 +Node: Getline/File242910 +Node: Getline/Variable/File244294 +Ref: Getline/Variable/File-Footnote-1245893 +Node: Getline/Pipe245980 +Node: Getline/Variable/Pipe248679 +Node: Getline/Coprocess249786 +Node: Getline/Variable/Coprocess251038 +Node: Getline Notes251775 +Node: Getline Summary254579 +Ref: table-getline-variants254987 +Node: Read Timeout255899 +Ref: Read Timeout-Footnote-1259726 +Node: Command-line directories259784 +Node: Input Summary260688 +Node: Input Exercises263825 +Node: Printing264558 +Node: Print266280 +Node: Print Examples267621 +Node: Output Separators270400 +Node: OFMT272416 +Node: Printf273774 +Node: Basic Printf274680 +Node: Control Letters276219 +Node: Format Modifiers280210 +Node: Printf Examples286237 +Node: Redirection288701 +Node: Special Files295673 +Node: Special FD296206 +Ref: Special FD-Footnote-1299803 +Node: Special Network299877 +Node: Special Caveats300727 +Node: Close Files And Pipes301523 +Ref: Close Files And Pipes-Footnote-1308684 +Ref: Close Files And Pipes-Footnote-2308832 +Node: Output Summary308982 +Node: Output exercises309979 +Node: Expressions310659 +Node: Values311844 +Node: Constants312520 +Node: Scalar Constants313200 +Ref: Scalar Constants-Footnote-1314059 +Node: Nondecimal-numbers314309 +Node: Regexp Constants317309 +Node: Using Constant Regexps317784 +Node: Variables320856 +Node: Using Variables321511 +Node: Assignment Options323235 +Node: Conversion325110 +Node: Strings And Numbers325634 +Ref: Strings And Numbers-Footnote-1328696 +Node: Locale influences conversions328805 +Ref: table-locale-affects331522 +Node: All Operators332110 +Node: Arithmetic Ops332740 +Node: Concatenation335245 +Ref: Concatenation-Footnote-1338064 +Node: Assignment Ops338184 +Ref: table-assign-ops343167 +Node: Increment Ops344484 +Node: Truth Values and Conditions347922 +Node: Truth Values349005 +Node: Typing and Comparison350054 +Node: Variable Typing350847 +Node: Comparison Operators354499 +Ref: table-relational-ops354909 +Node: POSIX String Comparison358459 +Ref: POSIX String Comparison-Footnote-1359543 +Node: Boolean Ops359681 +Ref: Boolean Ops-Footnote-1363751 +Node: Conditional Exp363842 +Node: Function Calls365569 +Node: Precedence369449 +Node: Locales373118 +Node: Expressions Summary374749 +Node: Patterns and Actions377290 +Node: Pattern Overview378406 +Node: Regexp Patterns380083 +Node: Expression Patterns380626 +Node: Ranges384407 +Node: BEGIN/END387513 +Node: Using BEGIN/END388275 +Ref: Using BEGIN/END-Footnote-1391011 +Node: I/O And BEGIN/END391117 +Node: BEGINFILE/ENDFILE393402 +Node: Empty396333 +Node: Using Shell Variables396650 +Node: Action Overview398933 +Node: Statements401260 +Node: If Statement403108 +Node: While Statement404606 +Node: Do Statement406650 +Node: For Statement407806 +Node: Switch Statement410958 +Node: Break Statement413061 +Node: Continue Statement415116 +Node: Next Statement416909 +Node: Nextfile Statement419299 +Node: Exit Statement421954 +Node: Built-in Variables424358 +Node: User-modified425485 +Ref: User-modified-Footnote-1433174 +Node: Auto-set433236 +Ref: Auto-set-Footnote-1446155 +Ref: Auto-set-Footnote-2446360 +Node: ARGC and ARGV446416 +Node: Pattern Action Summary450270 +Node: Arrays452493 +Node: Array Basics454042 +Node: Array Intro454868 +Ref: figure-array-elements456841 +Node: Reference to Elements459248 +Node: Assigning Elements461521 +Node: Array Example462012 +Node: Scanning an Array463744 +Node: Controlling Scanning466759 +Ref: Controlling Scanning-Footnote-1471932 +Node: Delete472248 +Ref: Delete-Footnote-1475013 +Node: Numeric Array Subscripts475070 +Node: Uninitialized Subscripts477253 +Node: Multidimensional478878 +Node: Multiscanning481971 +Node: Arrays of Arrays483560 +Node: Arrays Summary488223 +Node: Functions490328 +Node: Built-in491201 +Node: Calling Built-in492279 +Node: Numeric Functions494267 +Ref: Numeric Functions-Footnote-1499011 +Ref: Numeric Functions-Footnote-2499368 +Ref: Numeric Functions-Footnote-3499416 +Node: String Functions499685 +Ref: String Functions-Footnote-1522696 +Ref: String Functions-Footnote-2522825 +Ref: String Functions-Footnote-3523073 +Node: Gory Details523160 +Ref: table-sub-escapes524947 +Ref: table-sub-proposed526467 +Ref: table-posix-sub527831 +Ref: table-gensub-escapes529371 +Ref: Gory Details-Footnote-1530547 +Node: I/O Functions530698 +Ref: I/O Functions-Footnote-1537821 +Node: Time Functions537968 +Ref: Time Functions-Footnote-1548432 +Ref: Time Functions-Footnote-2548500 +Ref: Time Functions-Footnote-3548658 +Ref: Time Functions-Footnote-4548769 +Ref: Time Functions-Footnote-5548881 +Ref: Time Functions-Footnote-6549108 +Node: Bitwise Functions549374 +Ref: table-bitwise-ops549936 +Ref: Bitwise Functions-Footnote-1554181 +Node: Type Functions554365 +Node: I18N Functions555507 +Node: User-defined557152 +Node: Definition Syntax557956 +Ref: Definition Syntax-Footnote-1563135 +Node: Function Example563204 +Ref: Function Example-Footnote-1565768 +Node: Function Caveats565790 +Node: Calling A Function566308 +Node: Variable Scope567263 +Node: Pass By Value/Reference570251 +Node: Return Statement573761 +Node: Dynamic Typing576745 +Node: Indirect Calls577674 +Node: Functions Summary587387 +Node: Library Functions589926 +Ref: Library Functions-Footnote-1593544 +Ref: Library Functions-Footnote-2593687 +Node: Library Names593858 +Ref: Library Names-Footnote-1597331 +Ref: Library Names-Footnote-2597551 +Node: General Functions597637 +Node: Strtonum Function598665 +Node: Assert Function601445 +Node: Round Function604771 +Node: Cliff Random Function606312 +Node: Ordinal Functions607328 +Ref: Ordinal Functions-Footnote-1610405 +Ref: Ordinal Functions-Footnote-2610657 +Node: Join Function610868 +Ref: Join Function-Footnote-1612639 +Node: Getlocaltime Function612839 +Node: Readfile Function616575 +Node: Data File Management618414 +Node: Filetrans Function619046 +Node: Rewind Function623115 +Node: File Checking624673 +Ref: File Checking-Footnote-1625805 +Node: Empty Files626006 +Node: Ignoring Assigns627985 +Node: Getopt Function629539 +Ref: Getopt Function-Footnote-1640842 +Node: Passwd Functions641045 +Ref: Passwd Functions-Footnote-1650024 +Node: Group Functions650112 +Ref: Group Functions-Footnote-1658053 +Node: Walking Arrays658266 +Node: Library Functions Summary659869 +Node: Library exercises661257 +Node: Sample Programs662537 +Node: Running Examples663307 +Node: Clones664035 +Node: Cut Program665259 +Node: Egrep Program675127 +Ref: Egrep Program-Footnote-1683098 +Node: Id Program683208 +Node: Split Program686872 +Ref: Split Program-Footnote-1690410 +Node: Tee Program690538 +Node: Uniq Program693345 +Node: Wc Program700775 +Ref: Wc Program-Footnote-1705040 +Node: Miscellaneous Programs705132 +Node: Dupword Program706345 +Node: Alarm Program708376 +Node: Translate Program713190 +Ref: Translate Program-Footnote-1717581 +Ref: Translate Program-Footnote-2717851 +Node: Labels Program717985 +Ref: Labels Program-Footnote-1721356 +Node: Word Sorting721440 +Node: History Sorting725483 +Node: Extract Program727319 +Node: Simple Sed734855 +Node: Igawk Program737917 +Ref: Igawk Program-Footnote-1752228 +Ref: Igawk Program-Footnote-2752429 +Node: Anagram Program752567 +Node: Signature Program755635 +Node: Programs Summary756882 +Node: Programs Exercises758097 +Node: Advanced Features761748 +Node: Nondecimal Data763696 +Node: Array Sorting765273 +Node: Controlling Array Traversal765970 +Node: Array Sorting Functions774250 +Ref: Array Sorting Functions-Footnote-1778157 +Node: Two-way I/O778351 +Ref: Two-way I/O-Footnote-1783295 +Ref: Two-way I/O-Footnote-2783474 +Node: TCP/IP Networking783556 +Node: Profiling786401 +Node: Advanced Features Summary793952 +Node: Internationalization795816 +Node: I18N and L10N797296 +Node: Explaining gettext797982 +Ref: Explaining gettext-Footnote-1803122 +Ref: Explaining gettext-Footnote-2803306 +Node: Programmer i18n803471 +Node: Translator i18n807696 +Node: String Extraction808490 +Ref: String Extraction-Footnote-1809451 +Node: Printf Ordering809537 +Ref: Printf Ordering-Footnote-1812319 +Node: I18N Portability812383 +Ref: I18N Portability-Footnote-1814832 +Node: I18N Example814895 +Ref: I18N Example-Footnote-1817617 +Node: Gawk I18N817689 +Node: I18N Summary818327 +Node: Debugger819666 +Node: Debugging820688 +Node: Debugging Concepts821129 +Node: Debugging Terms822985 +Node: Awk Debugging825582 +Node: Sample Debugging Session826474 +Node: Debugger Invocation826994 +Node: Finding The Bug828327 +Node: List of Debugger Commands834809 +Node: Breakpoint Control836141 +Node: Debugger Execution Control839805 +Node: Viewing And Changing Data843165 +Node: Execution Stack846523 +Node: Debugger Info848036 +Node: Miscellaneous Debugger Commands852030 +Node: Readline Support857214 +Node: Limitations858106 +Node: Debugging Summary860380 +Node: Arbitrary Precision Arithmetic861544 +Node: Computer Arithmetic863031 +Ref: Computer Arithmetic-Footnote-1867418 +Node: Math Definitions867475 +Ref: table-ieee-formats870764 +Ref: Math Definitions-Footnote-1871304 +Node: MPFR features871407 +Node: FP Math Caution873049 +Ref: FP Math Caution-Footnote-1874101 +Node: Inexactness of computations874470 +Node: Inexact representation875418 +Node: Comparing FP Values876773 +Node: Errors accumulate877737 +Node: Getting Accuracy879170 +Node: Try To Round881829 +Node: Setting precision882728 +Ref: table-predefined-precision-strings883410 +Node: Setting the rounding mode885203 +Ref: table-gawk-rounding-modes885567 +Ref: Setting the rounding mode-Footnote-1889021 +Node: Arbitrary Precision Integers889200 +Ref: Arbitrary Precision Integers-Footnote-1892995 +Node: POSIX Floating Point Problems893144 +Ref: POSIX Floating Point Problems-Footnote-1897020 +Node: Floating point summary897058 +Node: Dynamic Extensions899281 +Node: Extension Intro900833 +Node: Plugin License902098 +Node: Extension Mechanism Outline902783 +Ref: figure-load-extension903207 +Ref: figure-load-new-function904692 +Ref: figure-call-new-function905694 +Node: Extension API Description907678 +Node: Extension API Functions Introduction909128 +Node: General Data Types913993 +Ref: General Data Types-Footnote-1919686 +Node: Requesting Values919985 +Ref: table-value-types-returned920722 +Node: Memory Allocation Functions921680 +Ref: Memory Allocation Functions-Footnote-1924427 +Node: Constructor Functions924523 +Node: Registration Functions926281 +Node: Extension Functions926966 +Node: Exit Callback Functions929268 +Node: Extension Version String930517 +Node: Input Parsers931167 +Node: Output Wrappers940981 +Node: Two-way processors945497 +Node: Printing Messages947701 +Ref: Printing Messages-Footnote-1948778 +Node: Updating `ERRNO'948930 +Node: Accessing Parameters949669 +Node: Symbol Table Access950899 +Node: Symbol table by name951413 +Node: Symbol table by cookie953389 +Ref: Symbol table by cookie-Footnote-1957522 +Node: Cached values957585 +Ref: Cached values-Footnote-1961089 +Node: Array Manipulation961180 +Ref: Array Manipulation-Footnote-1962278 +Node: Array Data Types962317 +Ref: Array Data Types-Footnote-1965020 +Node: Array Functions965112 +Node: Flattening Arrays968986 +Node: Creating Arrays975838 +Node: Extension API Variables980569 +Node: Extension Versioning981205 +Node: Extension API Informational Variables983106 +Node: Extension API Boilerplate984192 +Node: Finding Extensions987996 +Node: Extension Example988556 +Node: Internal File Description989286 +Node: Internal File Ops993377 +Ref: Internal File Ops-Footnote-11004809 +Node: Using Internal File Ops1004949 +Ref: Using Internal File Ops-Footnote-11007296 +Node: Extension Samples1007564 +Node: Extension Sample File Functions1009088 +Node: Extension Sample Fnmatch1016656 +Node: Extension Sample Fork1018138 +Node: Extension Sample Inplace1019351 +Node: Extension Sample Ord1021026 +Node: Extension Sample Readdir1021862 +Ref: table-readdir-file-types1022718 +Node: Extension Sample Revout1023517 +Node: Extension Sample Rev2way1024108 +Node: Extension Sample Read write array1024849 +Node: Extension Sample Readfile1026728 +Node: Extension Sample API Tests1027828 +Node: Extension Sample Time1028353 +Node: gawkextlib1029668 +Node: Extension summary1032481 +Node: Extension Exercises1036174 +Node: Language History1036896 +Node: V7/SVR3.11038539 +Node: SVR41040859 +Node: POSIX1042301 +Node: BTL1043687 +Node: POSIX/GNU1044421 +Node: Feature History1050164 +Node: Common Extensions1063294 +Node: Ranges and Locales1064606 +Ref: Ranges and Locales-Footnote-11069223 +Ref: Ranges and Locales-Footnote-21069250 +Ref: Ranges and Locales-Footnote-31069484 +Node: Contributors1069705 +Node: History summary1075130 +Node: Installation1076499 +Node: Gawk Distribution1077450 +Node: Getting1077934 +Node: Extracting1078758 +Node: Distribution contents1080400 +Node: Unix Installation1086170 +Node: Quick Installation1086787 +Node: Additional Configuration Options1089229 +Node: Configuration Philosophy1090967 +Node: Non-Unix Installation1093318 +Node: PC Installation1093776 +Node: PC Binary Installation1095087 +Node: PC Compiling1096935 +Ref: PC Compiling-Footnote-11099934 +Node: PC Testing1100039 +Node: PC Using1101215 +Node: Cygwin1105373 +Node: MSYS1106182 +Node: VMS Installation1106696 +Node: VMS Compilation1107492 +Ref: VMS Compilation-Footnote-11108714 +Node: VMS Dynamic Extensions1108772 +Node: VMS Installation Details1110145 +Node: VMS Running1112397 +Node: VMS GNV1115231 +Node: VMS Old Gawk1115954 +Node: Bugs1116424 +Node: Other Versions1120428 +Node: Installation summary1126683 +Node: Notes1127739 +Node: Compatibility Mode1128604 +Node: Additions1129386 +Node: Accessing The Source1130311 +Node: Adding Code1131747 +Node: New Ports1137925 +Node: Derived Files1142406 +Ref: Derived Files-Footnote-11147487 +Ref: Derived Files-Footnote-21147521 +Ref: Derived Files-Footnote-31148117 +Node: Future Extensions1148231 +Node: Implementation Limitations1148837 +Node: Extension Design1150085 +Node: Old Extension Problems1151239 +Ref: Old Extension Problems-Footnote-11152756 +Node: Extension New Mechanism Goals1152813 +Ref: Extension New Mechanism Goals-Footnote-11156173 +Node: Extension Other Design Decisions1156362 +Node: Extension Future Growth1158468 +Node: Old Extension Mechanism1159304 +Node: Notes summary1161066 +Node: Basic Concepts1162252 +Node: Basic High Level1162933 +Ref: figure-general-flow1163205 +Ref: figure-process-flow1163804 +Ref: Basic High Level-Footnote-11167033 +Node: Basic Data Typing1167218 +Node: Glossary1170546 +Node: Copying1195698 +Node: GNU Free Documentation License1233254 +Node: Index1258390 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index c0b979d1..6041473c 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -7142,6 +7142,8 @@ shell, without any quotes, the @samp{\} gets deleted, so @command{awk} figures that you really want your fields to be separated with TABs and not @samp{t}s. Use @samp{-v FS="t"} or @samp{-F"[t]"} on the command line if you really do want to separate your fields with @samp{t}s. +Use @samp{-F '\t'} when not in compatibility mode to specify that TABs +separate fields. As an example, let's use an @command{awk} program file called @file{edu.awk} that contains the pattern @code{/edu/} and the action @samp{print $1}: @@ -7292,7 +7294,7 @@ root @noindent on an incorrect implementation of @command{awk}, while @command{gawk} -prints something like: +prints the full first line of the file, something like: @example root:nSijPlPhZZwgE:0:0:Root:/: @@ -7345,7 +7347,7 @@ root @noindent on an incorrect implementation of @command{awk}, while @command{gawk} -prints something like: +prints the full first line of the file, something like: @example root:nSijPlPhZZwgE:0:0:Root:/: @@ -7482,7 +7484,7 @@ haven't been introduced yet. BEGIN @{ FIELDWIDTHS = "9 6 10 6 7 7 35" @} NR > 2 @{ idle = $4 - sub(/^ */, "", idle) # strip leading spaces + sub(/^ +/, "", idle) # strip leading spaces if (idle == "") idle = 0 if (idle ~ /:/) @{ @@ -7640,6 +7642,8 @@ if (substr($i, 1, 1) == "\"") @{ As with @code{FS}, the @code{IGNORECASE} variable (@pxref{User-modified}) affects field splitting with @code{FPAT}. +Assigning a value to @code{FPAT} overrides field splitting +with @code{FS} and with @code{FIELDWIDTHS}. Similar to @code{FIELDWIDTHS}, the value of @code{PROCINFO["FS"]} will be @code{"FPAT"} if content-based field splitting is being used. @@ -7663,6 +7667,12 @@ FPAT = "([^,]*)|(\"[^\"]+\")" Finally, the @code{patsplit()} function makes the same functionality available for splitting regular strings (@pxref{String Functions}). +To recap, @command{gawk} provides three independent methods +to split input records into fields. @command{gawk} uses whichever +mechanism was last chosen based on which of the three +variables---@code{FS}, @code{FIELDWIDTHS}, and @code{FPAT}---was +last assigned to. + @node Multiple Line @section Multiple-Line Records @@ -9693,7 +9703,7 @@ It then sends the list to the shell for execution. @c ENDOFRANGE reout @node Special Files -@section Special @value{FFN} in @command{gawk} +@section Special @value{FFN}s in @command{gawk} @c STARTOFRANGE gfn @cindex @command{gawk}, file names in @@ -11917,7 +11927,7 @@ made of characters and is therefore also a string. Thus, for example, the string constant @w{@code{" +3.14"}}, when it appears in program source code, is a string---even though it looks numeric---and -is @emph{never} treated as number for comparison +is @emph{never} treated as a number for comparison purposes. In short, when one operand is a ``pure'' string, such as a string @@ -30007,7 +30017,7 @@ to follow. @quotation Math class is tough! -@author Late 1980's Barbie +@author Teen Talk Barbie (July, 1992) @end quotation This @value{SECTION} provides a high level overview of the issues @@ -30672,7 +30682,7 @@ values. The default for @command{awk} is to use double-precision floating-point values. @item -In the 1980's, Barbie mistakenly said ``Math class is tough!'' +In the early 1990's, Barbie mistakenly said ``Math class is tough!'' While math isn't tough, floating-point arithmetic isn't the same as pencil and paper math, and care must be taken: diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 5460dec3..652a38fa 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -6856,6 +6856,8 @@ shell, without any quotes, the @samp{\} gets deleted, so @command{awk} figures that you really want your fields to be separated with TABs and not @samp{t}s. Use @samp{-v FS="t"} or @samp{-F"[t]"} on the command line if you really do want to separate your fields with @samp{t}s. +Use @samp{-F '\t'} when not in compatibility mode to specify that TABs +separate fields. As an example, let's use an @command{awk} program file called @file{edu.awk} that contains the pattern @code{/edu/} and the action @samp{print $1}: @@ -7001,7 +7003,7 @@ root @noindent on an incorrect implementation of @command{awk}, while @command{gawk} -prints something like: +prints the full first line of the file, something like: @example root:nSijPlPhZZwgE:0:0:Root:/: @@ -7101,7 +7103,7 @@ haven't been introduced yet. BEGIN @{ FIELDWIDTHS = "9 6 10 6 7 7 35" @} NR > 2 @{ idle = $4 - sub(/^ */, "", idle) # strip leading spaces + sub(/^ +/, "", idle) # strip leading spaces if (idle == "") idle = 0 if (idle ~ /:/) @{ @@ -7259,6 +7261,8 @@ if (substr($i, 1, 1) == "\"") @{ As with @code{FS}, the @code{IGNORECASE} variable (@pxref{User-modified}) affects field splitting with @code{FPAT}. +Assigning a value to @code{FPAT} overrides field splitting +with @code{FS} and with @code{FIELDWIDTHS}. Similar to @code{FIELDWIDTHS}, the value of @code{PROCINFO["FS"]} will be @code{"FPAT"} if content-based field splitting is being used. @@ -7282,6 +7286,12 @@ FPAT = "([^,]*)|(\"[^\"]+\")" Finally, the @code{patsplit()} function makes the same functionality available for splitting regular strings (@pxref{String Functions}). +To recap, @command{gawk} provides three independent methods +to split input records into fields. @command{gawk} uses whichever +mechanism was last chosen based on which of the three +variables---@code{FS}, @code{FIELDWIDTHS}, and @code{FPAT}---was +last assigned to. + @node Multiple Line @section Multiple-Line Records @@ -9274,7 +9284,7 @@ It then sends the list to the shell for execution. @c ENDOFRANGE reout @node Special Files -@section Special @value{FFN} in @command{gawk} +@section Special @value{FFN}s in @command{gawk} @c STARTOFRANGE gfn @cindex @command{gawk}, file names in @@ -11268,7 +11278,7 @@ made of characters and is therefore also a string. Thus, for example, the string constant @w{@code{" +3.14"}}, when it appears in program source code, is a string---even though it looks numeric---and -is @emph{never} treated as number for comparison +is @emph{never} treated as a number for comparison purposes. In short, when one operand is a ``pure'' string, such as a string @@ -29122,7 +29132,7 @@ to follow. @quotation Math class is tough! -@author Late 1980's Barbie +@author Teen Talk Barbie (July, 1992) @end quotation This @value{SECTION} provides a high level overview of the issues @@ -29787,7 +29797,7 @@ values. The default for @command{awk} is to use double-precision floating-point values. @item -In the 1980's, Barbie mistakenly said ``Math class is tough!'' +In the early 1990's, Barbie mistakenly said ``Math class is tough!'' While math isn't tough, floating-point arithmetic isn't the same as pencil and paper math, and care must be taken: |