From 771ead66d55eee963444a4cd946d23886e11bd03 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 18 Feb 2016 21:20:06 +0200 Subject: Update NEWS w.r.t. pretty printing of else-ifs. --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 09a34ffd..2de7c22e 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,9 @@ Changes from 4.1.3 to 4.1.x 6. VMS support has been updated. +7. The profiler / pretty-printer now chains else-if statements instead + of causing cascading elses. + Changes from 4.1.2 to 4.1.3 --------------------------- -- cgit v1.2.3 From 662eb8ea3cdbafed16f2d3abb06c3a03e1c92526 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 18 Feb 2016 21:49:33 +0200 Subject: Fixes to sample programs in the doc. --- awklib/eg/prog/cut.awk | 4 +- awklib/eg/prog/wc.awk | 2 +- doc/ChangeLog | 6 + doc/gawk.info | 575 ++++++++++++++++++++++++++----------------------- doc/gawk.texi | 45 +++- doc/gawktexi.in | 45 +++- 6 files changed, 392 insertions(+), 285 deletions(-) diff --git a/awklib/eg/prog/cut.awk b/awklib/eg/prog/cut.awk index 080279bc..fd77910d 100644 --- a/awklib/eg/prog/cut.awk +++ b/awklib/eg/prog/cut.awk @@ -35,7 +35,7 @@ BEGIN { " for delimiter\n", Optarg) > "/dev/stderr" Optarg = substr(Optarg, 1, 1) } - FS = Optarg + fs = FS = Optarg OFS = FS if (FS == " ") # defeat awk semantics FS = "[ ]" @@ -123,7 +123,7 @@ function set_charlist( field, i, j, f, g, n, m, t, nfields = j - 1 } { - if (by_fields && suppress && index($0, FS) == 0) + if (by_fields && suppress && index($0, fs) == 0) next for (i = 1; i <= nfields; i++) { diff --git a/awklib/eg/prog/wc.awk b/awklib/eg/prog/wc.awk index 95940ae4..c46d0984 100644 --- a/awklib/eg/prog/wc.awk +++ b/awklib/eg/prog/wc.awk @@ -30,7 +30,7 @@ BEGIN { if (! do_lines && ! do_words && ! do_chars) do_lines = do_words = do_chars = 1 - print_total = (ARGC - i > 2) + print_total = (ARGC - i > 1) } function beginfile(file) { diff --git a/doc/ChangeLog b/doc/ChangeLog index 7ecd1b99..d3afeed8 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2016-02-18 Arnold D. Robbins + + * gawktexi.in: Fixes in wc.awk and in cut.awk. Thanks to David Ward, + dlward134@gmail.com. Added an example of use of rewind(), also + per suggestion from David Ward. + 2016-02-14 Arnold D. Robbins * gawktexi.in: Revise for use with Texinfo 6.1. diff --git a/doc/gawk.info b/doc/gawk.info index f66dacbc..08c774cd 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -15256,6 +15256,33 @@ should not call it from an 'ENDFILE' rule. (This isn't necessary anyway, because 'gawk' goes to the next file as soon as an 'ENDFILE' rule finishes!) + You need to be careful calling 'rewind()'. You can end up causing +infinite recursion if you don't pay attenion. Here is an example use: + + $ cat data + -| a + -| b + -| c + -| d + -| e + + $ cat test.awk + -| FNR == 3 && ! rewound { + -| rewound = 1 + -| rewind() + -| } + -| + -| { print FILENAME, FNR, $0 } + + $ gawk -f rewind.awk -f test.awk data + -| data 1 a + -| data 2 b + -| data 1 a + -| data 2 b + -| data 3 c + -| data 4 d + -| data 5 e +  File: gawk.info, Node: File Checking, Next: Empty Files, Prev: Rewind Function, Up: Data File Management @@ -16479,7 +16506,7 @@ by characters, the output field separator is set to the null string: " for delimiter\n", Optarg) > "/dev/stderr" Optarg = substr(Optarg, 1, 1) } - FS = Optarg + fs = FS = Optarg OFS = FS if (FS == " ") # defeat awk semantics FS = "[ ]" @@ -16496,11 +16523,15 @@ by characters, the output field separator is set to the null string: The code must take special care when the field delimiter is a space. Using a single space ('" "') for the value of 'FS' is incorrect--'awk' would separate fields with runs of spaces, TABs, and/or newlines, and we -want them to be separated with individual spaces. Also remember that -after 'getopt()' is through (as described in *note Getopt Function::), -we have to clear out all the elements of 'ARGV' from 1 to 'Optind', so -that 'awk' does not try to process the command-line options as file -names. +want them to be separated with individual spaces. To this end, we save +the original space character in the variable 'fs' for later use; after +setting 'FS' to '"[ ]"' we can't use it directly to see if the field +delimiter character is in the string. + + Also remember that after 'getopt()' is through (as described in *note +Getopt Function::), we have to clear out all the elements of 'ARGV' from +1 to 'Optind', so that 'awk' does not try to process the command-line +options as file names. After dealing with the command-line options, the program verifies that the options make sense. Only one or the other of '-c' and '-f' @@ -16623,8 +16654,8 @@ printed. The corresponding field is printed if it contains data. If the next field also has data, then the separator character is written out between the fields: - { - if (by_fields && suppress && index($0, FS) == 0) + + if (by_fields && suppress && index($0, fs) == 0) next for (i = 1; i <= nfields; i++) { @@ -17454,7 +17485,7 @@ line: if (! do_lines && ! do_words && ! do_chars) do_lines = do_words = do_chars = 1 - print_total = (ARGC - i > 2) + print_total = (ARGC - i > 1) } The 'beginfile()' function is simple; it just resets the counts of @@ -34884,268 +34915,268 @@ Node: Shell Quoting629481 Node: Data File Management630882 Node: Filetrans Function631514 Node: Rewind Function635610 -Node: File Checking636996 -Ref: File Checking-Footnote-1638330 -Node: Empty Files638531 -Node: Ignoring Assigns640510 -Node: Getopt Function642060 -Ref: Getopt Function-Footnote-1653529 -Node: Passwd Functions653729 -Ref: Passwd Functions-Footnote-1662568 -Node: Group Functions662656 -Ref: Group Functions-Footnote-1670553 -Node: Walking Arrays670760 -Node: Library Functions Summary673768 -Node: Library Exercises675174 -Node: Sample Programs675639 -Node: Running Examples676409 -Node: Clones677137 -Node: Cut Program678361 -Node: Egrep Program688082 -Ref: Egrep Program-Footnote-1695594 -Node: Id Program695704 -Node: Split Program699384 -Ref: Split Program-Footnote-1702843 -Node: Tee Program702972 -Node: Uniq Program705762 -Node: Wc Program713188 -Ref: Wc Program-Footnote-1717443 -Node: Miscellaneous Programs717537 -Node: Dupword Program718750 -Node: Alarm Program720780 -Node: Translate Program725635 -Ref: Translate Program-Footnote-1730200 -Node: Labels Program730470 -Ref: Labels Program-Footnote-1733821 -Node: Word Sorting733905 -Node: History Sorting737977 -Node: Extract Program739812 -Node: Simple Sed747341 -Node: Igawk Program750415 -Ref: Igawk Program-Footnote-1764746 -Ref: Igawk Program-Footnote-2764948 -Ref: Igawk Program-Footnote-3765070 -Node: Anagram Program765185 -Node: Signature Program768247 -Node: Programs Summary769494 -Node: Programs Exercises770708 -Ref: Programs Exercises-Footnote-1774837 -Node: Advanced Features774928 -Node: Nondecimal Data776918 -Node: Array Sorting778509 -Node: Controlling Array Traversal779209 -Ref: Controlling Array Traversal-Footnote-1787576 -Node: Array Sorting Functions787694 -Ref: Array Sorting Functions-Footnote-1792785 -Node: Two-way I/O792981 -Ref: Two-way I/O-Footnote-1798801 -Ref: Two-way I/O-Footnote-2798988 -Node: TCP/IP Networking799070 -Node: Profiling802188 -Node: Advanced Features Summary809727 -Node: Internationalization811663 -Node: I18N and L10N813143 -Node: Explaining gettext813830 -Ref: Explaining gettext-Footnote-1818853 -Ref: Explaining gettext-Footnote-2819038 -Node: Programmer i18n819203 -Ref: Programmer i18n-Footnote-1824058 -Node: Translator i18n824107 -Node: String Extraction824901 -Ref: String Extraction-Footnote-1826033 -Node: Printf Ordering826119 -Ref: Printf Ordering-Footnote-1828905 -Node: I18N Portability828969 -Ref: I18N Portability-Footnote-1831425 -Node: I18N Example831488 -Ref: I18N Example-Footnote-1834294 -Node: Gawk I18N834367 -Node: I18N Summary835012 -Node: Debugger836353 -Node: Debugging837375 -Node: Debugging Concepts837816 -Node: Debugging Terms839625 -Node: Awk Debugging842200 -Node: Sample Debugging Session843106 -Node: Debugger Invocation843640 -Node: Finding The Bug845026 -Node: List of Debugger Commands851504 -Node: Breakpoint Control852837 -Node: Debugger Execution Control856531 -Node: Viewing And Changing Data859893 -Node: Execution Stack863267 -Node: Debugger Info864904 -Node: Miscellaneous Debugger Commands868975 -Node: Readline Support874063 -Node: Limitations874959 -Node: Debugging Summary877068 -Node: Arbitrary Precision Arithmetic878241 -Node: Computer Arithmetic879657 -Ref: table-numeric-ranges883248 -Ref: Computer Arithmetic-Footnote-1883970 -Node: Math Definitions884027 -Ref: table-ieee-formats887341 -Ref: Math Definitions-Footnote-1887944 -Node: MPFR features888049 -Node: FP Math Caution889766 -Ref: FP Math Caution-Footnote-1890838 -Node: Inexactness of computations891207 -Node: Inexact representation892167 -Node: Comparing FP Values893527 -Node: Errors accumulate894609 -Node: Getting Accuracy896042 -Node: Try To Round898752 -Node: Setting precision899651 -Ref: table-predefined-precision-strings900348 -Node: Setting the rounding mode902178 -Ref: table-gawk-rounding-modes902552 -Ref: Setting the rounding mode-Footnote-1905960 -Node: Arbitrary Precision Integers906139 -Ref: Arbitrary Precision Integers-Footnote-1909123 -Node: POSIX Floating Point Problems909272 -Ref: POSIX Floating Point Problems-Footnote-1913154 -Node: Floating point summary913192 -Node: Dynamic Extensions915382 -Node: Extension Intro916935 -Node: Plugin License918201 -Node: Extension Mechanism Outline918998 -Ref: figure-load-extension919437 -Ref: figure-register-new-function921002 -Ref: figure-call-new-function922094 -Node: Extension API Description924156 -Node: Extension API Functions Introduction925604 -Node: General Data Types930416 -Ref: General Data Types-Footnote-1936371 -Node: Memory Allocation Functions936670 -Ref: Memory Allocation Functions-Footnote-1939515 -Node: Constructor Functions939614 -Node: Registration Functions941359 -Node: Extension Functions942044 -Node: Exit Callback Functions944343 -Node: Extension Version String945593 -Node: Input Parsers946256 -Node: Output Wrappers956141 -Node: Two-way processors960653 -Node: Printing Messages962917 -Ref: Printing Messages-Footnote-1963991 -Node: Updating ERRNO964144 -Node: Requesting Values964883 -Ref: table-value-types-returned965620 -Node: Accessing Parameters966503 -Node: Symbol Table Access967738 -Node: Symbol table by name968250 -Node: Symbol table by cookie970271 -Ref: Symbol table by cookie-Footnote-1974420 -Node: Cached values974484 -Ref: Cached values-Footnote-1977985 -Node: Array Manipulation978076 -Ref: Array Manipulation-Footnote-1979175 -Node: Array Data Types979212 -Ref: Array Data Types-Footnote-1981870 -Node: Array Functions981962 -Node: Flattening Arrays985820 -Node: Creating Arrays992728 -Node: Extension API Variables997499 -Node: Extension Versioning998135 -Node: Extension API Informational Variables1000026 -Node: Extension API Boilerplate1001090 -Node: Finding Extensions1004904 -Node: Extension Example1005463 -Node: Internal File Description1006261 -Node: Internal File Ops1010341 -Ref: Internal File Ops-Footnote-11022103 -Node: Using Internal File Ops1022243 -Ref: Using Internal File Ops-Footnote-11024626 -Node: Extension Samples1024900 -Node: Extension Sample File Functions1026429 -Node: Extension Sample Fnmatch1034078 -Node: Extension Sample Fork1035565 -Node: Extension Sample Inplace1036783 -Node: Extension Sample Ord1039993 -Node: Extension Sample Readdir1040829 -Ref: table-readdir-file-types1041718 -Node: Extension Sample Revout1042523 -Node: Extension Sample Rev2way1043112 -Node: Extension Sample Read write array1043852 -Node: Extension Sample Readfile1045794 -Node: Extension Sample Time1046889 -Node: Extension Sample API Tests1048237 -Node: gawkextlib1048729 -Node: Extension summary1051153 -Node: Extension Exercises1054845 -Node: Language History1056342 -Node: V7/SVR3.11057998 -Node: SVR41060150 -Node: POSIX1061584 -Node: BTL1062963 -Node: POSIX/GNU1063692 -Node: Feature History1069213 -Node: Common Extensions1082542 -Node: Ranges and Locales1083825 -Ref: Ranges and Locales-Footnote-11088441 -Ref: Ranges and Locales-Footnote-21088468 -Ref: Ranges and Locales-Footnote-31088703 -Node: Contributors1088924 -Node: History summary1094493 -Node: Installation1095873 -Node: Gawk Distribution1096817 -Node: Getting1097301 -Node: Extracting1098262 -Node: Distribution contents1099900 -Node: Unix Installation1105651 -Node: Quick Installation1106267 -Node: Additional Configuration Options1108694 -Node: Configuration Philosophy1110498 -Node: Non-Unix Installation1112867 -Node: PC Installation1113325 -Node: PC Binary Installation1114645 -Node: PC Compiling1116497 -Ref: PC Compiling-Footnote-11119521 -Node: PC Testing1119630 -Node: PC Using1120810 -Node: Cygwin1124924 -Node: MSYS1125694 -Node: VMS Installation1126195 -Node: VMS Compilation1126986 -Ref: VMS Compilation-Footnote-11128215 -Node: VMS Dynamic Extensions1128273 -Node: VMS Installation Details1129958 -Node: VMS Running1132211 -Node: VMS GNV1136490 -Node: VMS Old Gawk1137225 -Node: Bugs1137696 -Node: Other Versions1141893 -Node: Installation summary1148477 -Node: Notes1149535 -Node: Compatibility Mode1150400 -Node: Additions1151182 -Node: Accessing The Source1152107 -Node: Adding Code1153542 -Node: New Ports1159761 -Node: Derived Files1164249 -Ref: Derived Files-Footnote-11169734 -Ref: Derived Files-Footnote-21169769 -Ref: Derived Files-Footnote-31170367 -Node: Future Extensions1170481 -Node: Implementation Limitations1171139 -Node: Extension Design1172322 -Node: Old Extension Problems1173476 -Ref: Old Extension Problems-Footnote-11174994 -Node: Extension New Mechanism Goals1175051 -Ref: Extension New Mechanism Goals-Footnote-11178415 -Node: Extension Other Design Decisions1178604 -Node: Extension Future Growth1180717 -Node: Old Extension Mechanism1181553 -Node: Notes summary1183316 -Node: Basic Concepts1184498 -Node: Basic High Level1185179 -Ref: figure-general-flow1185461 -Ref: figure-process-flow1186146 -Ref: Basic High Level-Footnote-11189447 -Node: Basic Data Typing1189632 -Node: Glossary1192960 -Node: Copying1224906 -Node: GNU Free Documentation License1262445 -Node: Index1287563 +Node: File Checking637515 +Ref: File Checking-Footnote-1638849 +Node: Empty Files639050 +Node: Ignoring Assigns641029 +Node: Getopt Function642579 +Ref: Getopt Function-Footnote-1654048 +Node: Passwd Functions654248 +Ref: Passwd Functions-Footnote-1663087 +Node: Group Functions663175 +Ref: Group Functions-Footnote-1671072 +Node: Walking Arrays671279 +Node: Library Functions Summary674287 +Node: Library Exercises675693 +Node: Sample Programs676158 +Node: Running Examples676928 +Node: Clones677656 +Node: Cut Program678880 +Node: Egrep Program688803 +Ref: Egrep Program-Footnote-1696315 +Node: Id Program696425 +Node: Split Program700105 +Ref: Split Program-Footnote-1703564 +Node: Tee Program703693 +Node: Uniq Program706483 +Node: Wc Program713909 +Ref: Wc Program-Footnote-1718164 +Node: Miscellaneous Programs718258 +Node: Dupword Program719471 +Node: Alarm Program721501 +Node: Translate Program726356 +Ref: Translate Program-Footnote-1730921 +Node: Labels Program731191 +Ref: Labels Program-Footnote-1734542 +Node: Word Sorting734626 +Node: History Sorting738698 +Node: Extract Program740533 +Node: Simple Sed748062 +Node: Igawk Program751136 +Ref: Igawk Program-Footnote-1765467 +Ref: Igawk Program-Footnote-2765669 +Ref: Igawk Program-Footnote-3765791 +Node: Anagram Program765906 +Node: Signature Program768968 +Node: Programs Summary770215 +Node: Programs Exercises771429 +Ref: Programs Exercises-Footnote-1775558 +Node: Advanced Features775649 +Node: Nondecimal Data777639 +Node: Array Sorting779230 +Node: Controlling Array Traversal779930 +Ref: Controlling Array Traversal-Footnote-1788297 +Node: Array Sorting Functions788415 +Ref: Array Sorting Functions-Footnote-1793506 +Node: Two-way I/O793702 +Ref: Two-way I/O-Footnote-1799522 +Ref: Two-way I/O-Footnote-2799709 +Node: TCP/IP Networking799791 +Node: Profiling802909 +Node: Advanced Features Summary810448 +Node: Internationalization812384 +Node: I18N and L10N813864 +Node: Explaining gettext814551 +Ref: Explaining gettext-Footnote-1819574 +Ref: Explaining gettext-Footnote-2819759 +Node: Programmer i18n819924 +Ref: Programmer i18n-Footnote-1824779 +Node: Translator i18n824828 +Node: String Extraction825622 +Ref: String Extraction-Footnote-1826754 +Node: Printf Ordering826840 +Ref: Printf Ordering-Footnote-1829626 +Node: I18N Portability829690 +Ref: I18N Portability-Footnote-1832146 +Node: I18N Example832209 +Ref: I18N Example-Footnote-1835015 +Node: Gawk I18N835088 +Node: I18N Summary835733 +Node: Debugger837074 +Node: Debugging838096 +Node: Debugging Concepts838537 +Node: Debugging Terms840346 +Node: Awk Debugging842921 +Node: Sample Debugging Session843827 +Node: Debugger Invocation844361 +Node: Finding The Bug845747 +Node: List of Debugger Commands852225 +Node: Breakpoint Control853558 +Node: Debugger Execution Control857252 +Node: Viewing And Changing Data860614 +Node: Execution Stack863988 +Node: Debugger Info865625 +Node: Miscellaneous Debugger Commands869696 +Node: Readline Support874784 +Node: Limitations875680 +Node: Debugging Summary877789 +Node: Arbitrary Precision Arithmetic878962 +Node: Computer Arithmetic880378 +Ref: table-numeric-ranges883969 +Ref: Computer Arithmetic-Footnote-1884691 +Node: Math Definitions884748 +Ref: table-ieee-formats888062 +Ref: Math Definitions-Footnote-1888665 +Node: MPFR features888770 +Node: FP Math Caution890487 +Ref: FP Math Caution-Footnote-1891559 +Node: Inexactness of computations891928 +Node: Inexact representation892888 +Node: Comparing FP Values894248 +Node: Errors accumulate895330 +Node: Getting Accuracy896763 +Node: Try To Round899473 +Node: Setting precision900372 +Ref: table-predefined-precision-strings901069 +Node: Setting the rounding mode902899 +Ref: table-gawk-rounding-modes903273 +Ref: Setting the rounding mode-Footnote-1906681 +Node: Arbitrary Precision Integers906860 +Ref: Arbitrary Precision Integers-Footnote-1909844 +Node: POSIX Floating Point Problems909993 +Ref: POSIX Floating Point Problems-Footnote-1913875 +Node: Floating point summary913913 +Node: Dynamic Extensions916103 +Node: Extension Intro917656 +Node: Plugin License918922 +Node: Extension Mechanism Outline919719 +Ref: figure-load-extension920158 +Ref: figure-register-new-function921723 +Ref: figure-call-new-function922815 +Node: Extension API Description924877 +Node: Extension API Functions Introduction926325 +Node: General Data Types931137 +Ref: General Data Types-Footnote-1937092 +Node: Memory Allocation Functions937391 +Ref: Memory Allocation Functions-Footnote-1940236 +Node: Constructor Functions940335 +Node: Registration Functions942080 +Node: Extension Functions942765 +Node: Exit Callback Functions945064 +Node: Extension Version String946314 +Node: Input Parsers946977 +Node: Output Wrappers956862 +Node: Two-way processors961374 +Node: Printing Messages963638 +Ref: Printing Messages-Footnote-1964712 +Node: Updating ERRNO964865 +Node: Requesting Values965604 +Ref: table-value-types-returned966341 +Node: Accessing Parameters967224 +Node: Symbol Table Access968459 +Node: Symbol table by name968971 +Node: Symbol table by cookie970992 +Ref: Symbol table by cookie-Footnote-1975141 +Node: Cached values975205 +Ref: Cached values-Footnote-1978706 +Node: Array Manipulation978797 +Ref: Array Manipulation-Footnote-1979896 +Node: Array Data Types979933 +Ref: Array Data Types-Footnote-1982591 +Node: Array Functions982683 +Node: Flattening Arrays986541 +Node: Creating Arrays993449 +Node: Extension API Variables998220 +Node: Extension Versioning998856 +Node: Extension API Informational Variables1000747 +Node: Extension API Boilerplate1001811 +Node: Finding Extensions1005625 +Node: Extension Example1006184 +Node: Internal File Description1006982 +Node: Internal File Ops1011062 +Ref: Internal File Ops-Footnote-11022824 +Node: Using Internal File Ops1022964 +Ref: Using Internal File Ops-Footnote-11025347 +Node: Extension Samples1025621 +Node: Extension Sample File Functions1027150 +Node: Extension Sample Fnmatch1034799 +Node: Extension Sample Fork1036286 +Node: Extension Sample Inplace1037504 +Node: Extension Sample Ord1040714 +Node: Extension Sample Readdir1041550 +Ref: table-readdir-file-types1042439 +Node: Extension Sample Revout1043244 +Node: Extension Sample Rev2way1043833 +Node: Extension Sample Read write array1044573 +Node: Extension Sample Readfile1046515 +Node: Extension Sample Time1047610 +Node: Extension Sample API Tests1048958 +Node: gawkextlib1049450 +Node: Extension summary1051874 +Node: Extension Exercises1055566 +Node: Language History1057063 +Node: V7/SVR3.11058719 +Node: SVR41060871 +Node: POSIX1062305 +Node: BTL1063684 +Node: POSIX/GNU1064413 +Node: Feature History1069934 +Node: Common Extensions1083263 +Node: Ranges and Locales1084546 +Ref: Ranges and Locales-Footnote-11089162 +Ref: Ranges and Locales-Footnote-21089189 +Ref: Ranges and Locales-Footnote-31089424 +Node: Contributors1089645 +Node: History summary1095214 +Node: Installation1096594 +Node: Gawk Distribution1097538 +Node: Getting1098022 +Node: Extracting1098983 +Node: Distribution contents1100621 +Node: Unix Installation1106372 +Node: Quick Installation1106988 +Node: Additional Configuration Options1109415 +Node: Configuration Philosophy1111219 +Node: Non-Unix Installation1113588 +Node: PC Installation1114046 +Node: PC Binary Installation1115366 +Node: PC Compiling1117218 +Ref: PC Compiling-Footnote-11120242 +Node: PC Testing1120351 +Node: PC Using1121531 +Node: Cygwin1125645 +Node: MSYS1126415 +Node: VMS Installation1126916 +Node: VMS Compilation1127707 +Ref: VMS Compilation-Footnote-11128936 +Node: VMS Dynamic Extensions1128994 +Node: VMS Installation Details1130679 +Node: VMS Running1132932 +Node: VMS GNV1137211 +Node: VMS Old Gawk1137946 +Node: Bugs1138417 +Node: Other Versions1142614 +Node: Installation summary1149198 +Node: Notes1150256 +Node: Compatibility Mode1151121 +Node: Additions1151903 +Node: Accessing The Source1152828 +Node: Adding Code1154263 +Node: New Ports1160482 +Node: Derived Files1164970 +Ref: Derived Files-Footnote-11170455 +Ref: Derived Files-Footnote-21170490 +Ref: Derived Files-Footnote-31171088 +Node: Future Extensions1171202 +Node: Implementation Limitations1171860 +Node: Extension Design1173043 +Node: Old Extension Problems1174197 +Ref: Old Extension Problems-Footnote-11175715 +Node: Extension New Mechanism Goals1175772 +Ref: Extension New Mechanism Goals-Footnote-11179136 +Node: Extension Other Design Decisions1179325 +Node: Extension Future Growth1181438 +Node: Old Extension Mechanism1182274 +Node: Notes summary1184037 +Node: Basic Concepts1185219 +Node: Basic High Level1185900 +Ref: figure-general-flow1186182 +Ref: figure-process-flow1186867 +Ref: Basic High Level-Footnote-11190168 +Node: Basic Data Typing1190353 +Node: Glossary1193681 +Node: Copying1225627 +Node: GNU Free Documentation License1263166 +Node: Index1288284  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index ec816c3b..3d90cd97 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -21653,6 +21653,36 @@ Because of this, you should not call it from an @code{ENDFILE} rule. (This isn't necessary anyway, because @command{gawk} goes to the next file as soon as an @code{ENDFILE} rule finishes!) +You need to be careful calling @code{rewind()}. You can end up +causing infinite recursion if you don't pay attenion. Here is an +example use: + +@example +$ @kbd{cat data} +@print{} a +@print{} b +@print{} c +@print{} d +@print{} e + +$ cat @kbd{test.awk} +@print{} FNR == 3 && ! rewound @{ +@print{} rewound = 1 +@print{} rewind() +@print{} @} +@print{} +@print{} @{ print FILENAME, FNR, $0 @} + +$ @kbd{gawk -f rewind.awk -f test.awk data } +@print{} data 1 a +@print{} data 2 b +@print{} data 1 a +@print{} data 2 b +@print{} data 3 c +@print{} data 4 d +@print{} data 5 e +@end example + @node File Checking @subsection Checking for Readable @value{DDF}s @@ -23349,7 +23379,7 @@ BEGIN @{ " for delimiter\n", Optarg) > "/dev/stderr" Optarg = substr(Optarg, 1, 1) @} - FS = Optarg + fs = FS = Optarg OFS = FS if (FS == " ") # defeat awk semantics FS = "[ ]" @@ -23371,7 +23401,12 @@ special care when the field delimiter is a space. Using a single space (@code{@w{" "}}) for the value of @code{FS} is incorrect---@command{awk} would separate fields with runs of spaces, TABs, and/or newlines, and we want them to be separated with individual -spaces. Also remember that after @code{getopt()} is through +spaces. +To this end, we save the original space character in the variable +@code{fs} for later use; after setting @code{FS} to @code{"[ ]"} we can't +use it directly to see if the field delimiter character is in the string. + +Also remember that after @code{getopt()} is through (as described in @ref{Getopt Function}), we have to clear out all the elements of @code{ARGV} from 1 to @code{Optind}, @@ -23522,8 +23557,8 @@ written out between the fields: @example @c file eg/prog/cut.awk -@{ - if (by_fields && suppress && index($0, FS) == 0) +{ + if (by_fields && suppress && index($0, fs) == 0) next for (i = 1; i <= nfields; i++) @{ @@ -24588,7 +24623,7 @@ BEGIN @{ if (! do_lines && ! do_words && ! do_chars) do_lines = do_words = do_chars = 1 - print_total = (ARGC - i > 2) + print_total = (ARGC - i > 1) @} @c endfile @end example diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 678fac36..5f60af39 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -20744,6 +20744,36 @@ Because of this, you should not call it from an @code{ENDFILE} rule. (This isn't necessary anyway, because @command{gawk} goes to the next file as soon as an @code{ENDFILE} rule finishes!) +You need to be careful calling @code{rewind()}. You can end up +causing infinite recursion if you don't pay attenion. Here is an +example use: + +@example +$ @kbd{cat data} +@print{} a +@print{} b +@print{} c +@print{} d +@print{} e + +$ cat @kbd{test.awk} +@print{} FNR == 3 && ! rewound @{ +@print{} rewound = 1 +@print{} rewind() +@print{} @} +@print{} +@print{} @{ print FILENAME, FNR, $0 @} + +$ @kbd{gawk -f rewind.awk -f test.awk data } +@print{} data 1 a +@print{} data 2 b +@print{} data 1 a +@print{} data 2 b +@print{} data 3 c +@print{} data 4 d +@print{} data 5 e +@end example + @node File Checking @subsection Checking for Readable @value{DDF}s @@ -22440,7 +22470,7 @@ BEGIN @{ " for delimiter\n", Optarg) > "/dev/stderr" Optarg = substr(Optarg, 1, 1) @} - FS = Optarg + fs = FS = Optarg OFS = FS if (FS == " ") # defeat awk semantics FS = "[ ]" @@ -22462,7 +22492,12 @@ special care when the field delimiter is a space. Using a single space (@code{@w{" "}}) for the value of @code{FS} is incorrect---@command{awk} would separate fields with runs of spaces, TABs, and/or newlines, and we want them to be separated with individual -spaces. Also remember that after @code{getopt()} is through +spaces. +To this end, we save the original space character in the variable +@code{fs} for later use; after setting @code{FS} to @code{"[ ]"} we can't +use it directly to see if the field delimiter character is in the string. + +Also remember that after @code{getopt()} is through (as described in @ref{Getopt Function}), we have to clear out all the elements of @code{ARGV} from 1 to @code{Optind}, @@ -22613,8 +22648,8 @@ written out between the fields: @example @c file eg/prog/cut.awk -@{ - if (by_fields && suppress && index($0, FS) == 0) +{ + if (by_fields && suppress && index($0, fs) == 0) next for (i = 1; i <= nfields; i++) @{ @@ -23679,7 +23714,7 @@ BEGIN @{ if (! do_lines && ! do_words && ! do_chars) do_lines = do_words = do_chars = 1 - print_total = (ARGC - i > 2) + print_total = (ARGC - i > 1) @} @c endfile @end example -- cgit v1.2.3 From bc2d7dbb2a431668312412a66db19e80da5b6651 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 18 Feb 2016 21:56:33 +0200 Subject: Update info about texinfo.tex versions. --- NEWS | 2 +- doc/ChangeLog | 1 + doc/gawk.texi | 5 +---- doc/gawktexi.in | 5 +---- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index 2de7c22e..871baa34 100644 --- a/NEWS +++ b/NEWS @@ -9,7 +9,7 @@ Changes from 4.1.3 to 4.1.x --------------------------- 1. Updated to GNU autoconf 2.69, automake 1.15, gettext 0.19.5.1, - texinfo 6.1. + texinfo 6.1, texinfo.tex 2016-02-05.07. 2. z/OS support updated. diff --git a/doc/ChangeLog b/doc/ChangeLog index d3afeed8..d368c606 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -3,6 +3,7 @@ * gawktexi.in: Fixes in wc.awk and in cut.awk. Thanks to David Ward, dlward134@gmail.com. Added an example of use of rewind(), also per suggestion from David Ward. + * gawktexi.in: Update info about Texinfo versions. 2016-02-14 Arnold D. Robbins diff --git a/doc/gawk.texi b/doc/gawk.texi index 3d90cd97..0e762565 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -225,10 +225,7 @@ @ignore Some comments on the layout for TeX. -1. Use at least texinfo.tex 2014-01-30.15 -2. When using @docbook, if the last line is part of a paragraph, end -it with a space and @c so that the lines won't run together. This is a -quirk of the language / makeinfo, and isn't going to change. +1. Use at least texinfo.tex 2016-02-05.07. @end ignore @c merge the function and variable indexes into the concept index diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 5f60af39..d0376304 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -220,10 +220,7 @@ @ignore Some comments on the layout for TeX. -1. Use at least texinfo.tex 2014-01-30.15 -2. When using @docbook, if the last line is part of a paragraph, end -it with a space and @c so that the lines won't run together. This is a -quirk of the language / makeinfo, and isn't going to change. +1. Use at least texinfo.tex 2016-02-05.07. @end ignore @c merge the function and variable indexes into the concept index -- cgit v1.2.3 From 7744707de0e95e1e0009204a7d4886d69db24530 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 18 Feb 2016 22:02:48 +0200 Subject: Typo fix in the manual. Sigh. --- doc/gawk.info | 494 ++++++++++++++++++++++++++++---------------------------- doc/gawk.texi | 2 +- doc/gawktexi.in | 2 +- 3 files changed, 249 insertions(+), 249 deletions(-) diff --git a/doc/gawk.info b/doc/gawk.info index 08c774cd..94516fd9 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -16654,7 +16654,7 @@ printed. The corresponding field is printed if it contains data. If the next field also has data, then the separator character is written out between the fields: - + { if (by_fields && suppress && index($0, fs) == 0) next @@ -34932,251 +34932,251 @@ Node: Sample Programs676158 Node: Running Examples676928 Node: Clones677656 Node: Cut Program678880 -Node: Egrep Program688803 -Ref: Egrep Program-Footnote-1696315 -Node: Id Program696425 -Node: Split Program700105 -Ref: Split Program-Footnote-1703564 -Node: Tee Program703693 -Node: Uniq Program706483 -Node: Wc Program713909 -Ref: Wc Program-Footnote-1718164 -Node: Miscellaneous Programs718258 -Node: Dupword Program719471 -Node: Alarm Program721501 -Node: Translate Program726356 -Ref: Translate Program-Footnote-1730921 -Node: Labels Program731191 -Ref: Labels Program-Footnote-1734542 -Node: Word Sorting734626 -Node: History Sorting738698 -Node: Extract Program740533 -Node: Simple Sed748062 -Node: Igawk Program751136 -Ref: Igawk Program-Footnote-1765467 -Ref: Igawk Program-Footnote-2765669 -Ref: Igawk Program-Footnote-3765791 -Node: Anagram Program765906 -Node: Signature Program768968 -Node: Programs Summary770215 -Node: Programs Exercises771429 -Ref: Programs Exercises-Footnote-1775558 -Node: Advanced Features775649 -Node: Nondecimal Data777639 -Node: Array Sorting779230 -Node: Controlling Array Traversal779930 -Ref: Controlling Array Traversal-Footnote-1788297 -Node: Array Sorting Functions788415 -Ref: Array Sorting Functions-Footnote-1793506 -Node: Two-way I/O793702 -Ref: Two-way I/O-Footnote-1799522 -Ref: Two-way I/O-Footnote-2799709 -Node: TCP/IP Networking799791 -Node: Profiling802909 -Node: Advanced Features Summary810448 -Node: Internationalization812384 -Node: I18N and L10N813864 -Node: Explaining gettext814551 -Ref: Explaining gettext-Footnote-1819574 -Ref: Explaining gettext-Footnote-2819759 -Node: Programmer i18n819924 -Ref: Programmer i18n-Footnote-1824779 -Node: Translator i18n824828 -Node: String Extraction825622 -Ref: String Extraction-Footnote-1826754 -Node: Printf Ordering826840 -Ref: Printf Ordering-Footnote-1829626 -Node: I18N Portability829690 -Ref: I18N Portability-Footnote-1832146 -Node: I18N Example832209 -Ref: I18N Example-Footnote-1835015 -Node: Gawk I18N835088 -Node: I18N Summary835733 -Node: Debugger837074 -Node: Debugging838096 -Node: Debugging Concepts838537 -Node: Debugging Terms840346 -Node: Awk Debugging842921 -Node: Sample Debugging Session843827 -Node: Debugger Invocation844361 -Node: Finding The Bug845747 -Node: List of Debugger Commands852225 -Node: Breakpoint Control853558 -Node: Debugger Execution Control857252 -Node: Viewing And Changing Data860614 -Node: Execution Stack863988 -Node: Debugger Info865625 -Node: Miscellaneous Debugger Commands869696 -Node: Readline Support874784 -Node: Limitations875680 -Node: Debugging Summary877789 -Node: Arbitrary Precision Arithmetic878962 -Node: Computer Arithmetic880378 -Ref: table-numeric-ranges883969 -Ref: Computer Arithmetic-Footnote-1884691 -Node: Math Definitions884748 -Ref: table-ieee-formats888062 -Ref: Math Definitions-Footnote-1888665 -Node: MPFR features888770 -Node: FP Math Caution890487 -Ref: FP Math Caution-Footnote-1891559 -Node: Inexactness of computations891928 -Node: Inexact representation892888 -Node: Comparing FP Values894248 -Node: Errors accumulate895330 -Node: Getting Accuracy896763 -Node: Try To Round899473 -Node: Setting precision900372 -Ref: table-predefined-precision-strings901069 -Node: Setting the rounding mode902899 -Ref: table-gawk-rounding-modes903273 -Ref: Setting the rounding mode-Footnote-1906681 -Node: Arbitrary Precision Integers906860 -Ref: Arbitrary Precision Integers-Footnote-1909844 -Node: POSIX Floating Point Problems909993 -Ref: POSIX Floating Point Problems-Footnote-1913875 -Node: Floating point summary913913 -Node: Dynamic Extensions916103 -Node: Extension Intro917656 -Node: Plugin License918922 -Node: Extension Mechanism Outline919719 -Ref: figure-load-extension920158 -Ref: figure-register-new-function921723 -Ref: figure-call-new-function922815 -Node: Extension API Description924877 -Node: Extension API Functions Introduction926325 -Node: General Data Types931137 -Ref: General Data Types-Footnote-1937092 -Node: Memory Allocation Functions937391 -Ref: Memory Allocation Functions-Footnote-1940236 -Node: Constructor Functions940335 -Node: Registration Functions942080 -Node: Extension Functions942765 -Node: Exit Callback Functions945064 -Node: Extension Version String946314 -Node: Input Parsers946977 -Node: Output Wrappers956862 -Node: Two-way processors961374 -Node: Printing Messages963638 -Ref: Printing Messages-Footnote-1964712 -Node: Updating ERRNO964865 -Node: Requesting Values965604 -Ref: table-value-types-returned966341 -Node: Accessing Parameters967224 -Node: Symbol Table Access968459 -Node: Symbol table by name968971 -Node: Symbol table by cookie970992 -Ref: Symbol table by cookie-Footnote-1975141 -Node: Cached values975205 -Ref: Cached values-Footnote-1978706 -Node: Array Manipulation978797 -Ref: Array Manipulation-Footnote-1979896 -Node: Array Data Types979933 -Ref: Array Data Types-Footnote-1982591 -Node: Array Functions982683 -Node: Flattening Arrays986541 -Node: Creating Arrays993449 -Node: Extension API Variables998220 -Node: Extension Versioning998856 -Node: Extension API Informational Variables1000747 -Node: Extension API Boilerplate1001811 -Node: Finding Extensions1005625 -Node: Extension Example1006184 -Node: Internal File Description1006982 -Node: Internal File Ops1011062 -Ref: Internal File Ops-Footnote-11022824 -Node: Using Internal File Ops1022964 -Ref: Using Internal File Ops-Footnote-11025347 -Node: Extension Samples1025621 -Node: Extension Sample File Functions1027150 -Node: Extension Sample Fnmatch1034799 -Node: Extension Sample Fork1036286 -Node: Extension Sample Inplace1037504 -Node: Extension Sample Ord1040714 -Node: Extension Sample Readdir1041550 -Ref: table-readdir-file-types1042439 -Node: Extension Sample Revout1043244 -Node: Extension Sample Rev2way1043833 -Node: Extension Sample Read write array1044573 -Node: Extension Sample Readfile1046515 -Node: Extension Sample Time1047610 -Node: Extension Sample API Tests1048958 -Node: gawkextlib1049450 -Node: Extension summary1051874 -Node: Extension Exercises1055566 -Node: Language History1057063 -Node: V7/SVR3.11058719 -Node: SVR41060871 -Node: POSIX1062305 -Node: BTL1063684 -Node: POSIX/GNU1064413 -Node: Feature History1069934 -Node: Common Extensions1083263 -Node: Ranges and Locales1084546 -Ref: Ranges and Locales-Footnote-11089162 -Ref: Ranges and Locales-Footnote-21089189 -Ref: Ranges and Locales-Footnote-31089424 -Node: Contributors1089645 -Node: History summary1095214 -Node: Installation1096594 -Node: Gawk Distribution1097538 -Node: Getting1098022 -Node: Extracting1098983 -Node: Distribution contents1100621 -Node: Unix Installation1106372 -Node: Quick Installation1106988 -Node: Additional Configuration Options1109415 -Node: Configuration Philosophy1111219 -Node: Non-Unix Installation1113588 -Node: PC Installation1114046 -Node: PC Binary Installation1115366 -Node: PC Compiling1117218 -Ref: PC Compiling-Footnote-11120242 -Node: PC Testing1120351 -Node: PC Using1121531 -Node: Cygwin1125645 -Node: MSYS1126415 -Node: VMS Installation1126916 -Node: VMS Compilation1127707 -Ref: VMS Compilation-Footnote-11128936 -Node: VMS Dynamic Extensions1128994 -Node: VMS Installation Details1130679 -Node: VMS Running1132932 -Node: VMS GNV1137211 -Node: VMS Old Gawk1137946 -Node: Bugs1138417 -Node: Other Versions1142614 -Node: Installation summary1149198 -Node: Notes1150256 -Node: Compatibility Mode1151121 -Node: Additions1151903 -Node: Accessing The Source1152828 -Node: Adding Code1154263 -Node: New Ports1160482 -Node: Derived Files1164970 -Ref: Derived Files-Footnote-11170455 -Ref: Derived Files-Footnote-21170490 -Ref: Derived Files-Footnote-31171088 -Node: Future Extensions1171202 -Node: Implementation Limitations1171860 -Node: Extension Design1173043 -Node: Old Extension Problems1174197 -Ref: Old Extension Problems-Footnote-11175715 -Node: Extension New Mechanism Goals1175772 -Ref: Extension New Mechanism Goals-Footnote-11179136 -Node: Extension Other Design Decisions1179325 -Node: Extension Future Growth1181438 -Node: Old Extension Mechanism1182274 -Node: Notes summary1184037 -Node: Basic Concepts1185219 -Node: Basic High Level1185900 -Ref: figure-general-flow1186182 -Ref: figure-process-flow1186867 -Ref: Basic High Level-Footnote-11190168 -Node: Basic Data Typing1190353 -Node: Glossary1193681 -Node: Copying1225627 -Node: GNU Free Documentation License1263166 -Node: Index1288284 +Node: Egrep Program688809 +Ref: Egrep Program-Footnote-1696321 +Node: Id Program696431 +Node: Split Program700111 +Ref: Split Program-Footnote-1703570 +Node: Tee Program703699 +Node: Uniq Program706489 +Node: Wc Program713915 +Ref: Wc Program-Footnote-1718170 +Node: Miscellaneous Programs718264 +Node: Dupword Program719477 +Node: Alarm Program721507 +Node: Translate Program726362 +Ref: Translate Program-Footnote-1730927 +Node: Labels Program731197 +Ref: Labels Program-Footnote-1734548 +Node: Word Sorting734632 +Node: History Sorting738704 +Node: Extract Program740539 +Node: Simple Sed748068 +Node: Igawk Program751142 +Ref: Igawk Program-Footnote-1765473 +Ref: Igawk Program-Footnote-2765675 +Ref: Igawk Program-Footnote-3765797 +Node: Anagram Program765912 +Node: Signature Program768974 +Node: Programs Summary770221 +Node: Programs Exercises771435 +Ref: Programs Exercises-Footnote-1775564 +Node: Advanced Features775655 +Node: Nondecimal Data777645 +Node: Array Sorting779236 +Node: Controlling Array Traversal779936 +Ref: Controlling Array Traversal-Footnote-1788303 +Node: Array Sorting Functions788421 +Ref: Array Sorting Functions-Footnote-1793512 +Node: Two-way I/O793708 +Ref: Two-way I/O-Footnote-1799528 +Ref: Two-way I/O-Footnote-2799715 +Node: TCP/IP Networking799797 +Node: Profiling802915 +Node: Advanced Features Summary810454 +Node: Internationalization812390 +Node: I18N and L10N813870 +Node: Explaining gettext814557 +Ref: Explaining gettext-Footnote-1819580 +Ref: Explaining gettext-Footnote-2819765 +Node: Programmer i18n819930 +Ref: Programmer i18n-Footnote-1824785 +Node: Translator i18n824834 +Node: String Extraction825628 +Ref: String Extraction-Footnote-1826760 +Node: Printf Ordering826846 +Ref: Printf Ordering-Footnote-1829632 +Node: I18N Portability829696 +Ref: I18N Portability-Footnote-1832152 +Node: I18N Example832215 +Ref: I18N Example-Footnote-1835021 +Node: Gawk I18N835094 +Node: I18N Summary835739 +Node: Debugger837080 +Node: Debugging838102 +Node: Debugging Concepts838543 +Node: Debugging Terms840352 +Node: Awk Debugging842927 +Node: Sample Debugging Session843833 +Node: Debugger Invocation844367 +Node: Finding The Bug845753 +Node: List of Debugger Commands852231 +Node: Breakpoint Control853564 +Node: Debugger Execution Control857258 +Node: Viewing And Changing Data860620 +Node: Execution Stack863994 +Node: Debugger Info865631 +Node: Miscellaneous Debugger Commands869702 +Node: Readline Support874790 +Node: Limitations875686 +Node: Debugging Summary877795 +Node: Arbitrary Precision Arithmetic878968 +Node: Computer Arithmetic880384 +Ref: table-numeric-ranges883975 +Ref: Computer Arithmetic-Footnote-1884697 +Node: Math Definitions884754 +Ref: table-ieee-formats888068 +Ref: Math Definitions-Footnote-1888671 +Node: MPFR features888776 +Node: FP Math Caution890493 +Ref: FP Math Caution-Footnote-1891565 +Node: Inexactness of computations891934 +Node: Inexact representation892894 +Node: Comparing FP Values894254 +Node: Errors accumulate895336 +Node: Getting Accuracy896769 +Node: Try To Round899479 +Node: Setting precision900378 +Ref: table-predefined-precision-strings901075 +Node: Setting the rounding mode902905 +Ref: table-gawk-rounding-modes903279 +Ref: Setting the rounding mode-Footnote-1906687 +Node: Arbitrary Precision Integers906866 +Ref: Arbitrary Precision Integers-Footnote-1909850 +Node: POSIX Floating Point Problems909999 +Ref: POSIX Floating Point Problems-Footnote-1913881 +Node: Floating point summary913919 +Node: Dynamic Extensions916109 +Node: Extension Intro917662 +Node: Plugin License918928 +Node: Extension Mechanism Outline919725 +Ref: figure-load-extension920164 +Ref: figure-register-new-function921729 +Ref: figure-call-new-function922821 +Node: Extension API Description924883 +Node: Extension API Functions Introduction926331 +Node: General Data Types931143 +Ref: General Data Types-Footnote-1937098 +Node: Memory Allocation Functions937397 +Ref: Memory Allocation Functions-Footnote-1940242 +Node: Constructor Functions940341 +Node: Registration Functions942086 +Node: Extension Functions942771 +Node: Exit Callback Functions945070 +Node: Extension Version String946320 +Node: Input Parsers946983 +Node: Output Wrappers956868 +Node: Two-way processors961380 +Node: Printing Messages963644 +Ref: Printing Messages-Footnote-1964718 +Node: Updating ERRNO964871 +Node: Requesting Values965610 +Ref: table-value-types-returned966347 +Node: Accessing Parameters967230 +Node: Symbol Table Access968465 +Node: Symbol table by name968977 +Node: Symbol table by cookie970998 +Ref: Symbol table by cookie-Footnote-1975147 +Node: Cached values975211 +Ref: Cached values-Footnote-1978712 +Node: Array Manipulation978803 +Ref: Array Manipulation-Footnote-1979902 +Node: Array Data Types979939 +Ref: Array Data Types-Footnote-1982597 +Node: Array Functions982689 +Node: Flattening Arrays986547 +Node: Creating Arrays993455 +Node: Extension API Variables998226 +Node: Extension Versioning998862 +Node: Extension API Informational Variables1000753 +Node: Extension API Boilerplate1001817 +Node: Finding Extensions1005631 +Node: Extension Example1006190 +Node: Internal File Description1006988 +Node: Internal File Ops1011068 +Ref: Internal File Ops-Footnote-11022830 +Node: Using Internal File Ops1022970 +Ref: Using Internal File Ops-Footnote-11025353 +Node: Extension Samples1025627 +Node: Extension Sample File Functions1027156 +Node: Extension Sample Fnmatch1034805 +Node: Extension Sample Fork1036292 +Node: Extension Sample Inplace1037510 +Node: Extension Sample Ord1040720 +Node: Extension Sample Readdir1041556 +Ref: table-readdir-file-types1042445 +Node: Extension Sample Revout1043250 +Node: Extension Sample Rev2way1043839 +Node: Extension Sample Read write array1044579 +Node: Extension Sample Readfile1046521 +Node: Extension Sample Time1047616 +Node: Extension Sample API Tests1048964 +Node: gawkextlib1049456 +Node: Extension summary1051880 +Node: Extension Exercises1055572 +Node: Language History1057069 +Node: V7/SVR3.11058725 +Node: SVR41060877 +Node: POSIX1062311 +Node: BTL1063690 +Node: POSIX/GNU1064419 +Node: Feature History1069940 +Node: Common Extensions1083269 +Node: Ranges and Locales1084552 +Ref: Ranges and Locales-Footnote-11089168 +Ref: Ranges and Locales-Footnote-21089195 +Ref: Ranges and Locales-Footnote-31089430 +Node: Contributors1089651 +Node: History summary1095220 +Node: Installation1096600 +Node: Gawk Distribution1097544 +Node: Getting1098028 +Node: Extracting1098989 +Node: Distribution contents1100627 +Node: Unix Installation1106378 +Node: Quick Installation1106994 +Node: Additional Configuration Options1109421 +Node: Configuration Philosophy1111225 +Node: Non-Unix Installation1113594 +Node: PC Installation1114052 +Node: PC Binary Installation1115372 +Node: PC Compiling1117224 +Ref: PC Compiling-Footnote-11120248 +Node: PC Testing1120357 +Node: PC Using1121537 +Node: Cygwin1125651 +Node: MSYS1126421 +Node: VMS Installation1126922 +Node: VMS Compilation1127713 +Ref: VMS Compilation-Footnote-11128942 +Node: VMS Dynamic Extensions1129000 +Node: VMS Installation Details1130685 +Node: VMS Running1132938 +Node: VMS GNV1137217 +Node: VMS Old Gawk1137952 +Node: Bugs1138423 +Node: Other Versions1142620 +Node: Installation summary1149204 +Node: Notes1150262 +Node: Compatibility Mode1151127 +Node: Additions1151909 +Node: Accessing The Source1152834 +Node: Adding Code1154269 +Node: New Ports1160488 +Node: Derived Files1164976 +Ref: Derived Files-Footnote-11170461 +Ref: Derived Files-Footnote-21170496 +Ref: Derived Files-Footnote-31171094 +Node: Future Extensions1171208 +Node: Implementation Limitations1171866 +Node: Extension Design1173049 +Node: Old Extension Problems1174203 +Ref: Old Extension Problems-Footnote-11175721 +Node: Extension New Mechanism Goals1175778 +Ref: Extension New Mechanism Goals-Footnote-11179142 +Node: Extension Other Design Decisions1179331 +Node: Extension Future Growth1181444 +Node: Old Extension Mechanism1182280 +Node: Notes summary1184043 +Node: Basic Concepts1185225 +Node: Basic High Level1185906 +Ref: figure-general-flow1186188 +Ref: figure-process-flow1186873 +Ref: Basic High Level-Footnote-11190174 +Node: Basic Data Typing1190359 +Node: Glossary1193687 +Node: Copying1225633 +Node: GNU Free Documentation License1263172 +Node: Index1288290  End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 0e762565..211a0a7e 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -23554,7 +23554,7 @@ written out between the fields: @example @c file eg/prog/cut.awk -{ +@{ if (by_fields && suppress && index($0, fs) == 0) next diff --git a/doc/gawktexi.in b/doc/gawktexi.in index d0376304..1a6b2dd8 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -22645,7 +22645,7 @@ written out between the fields: @example @c file eg/prog/cut.awk -{ +@{ if (by_fields && suppress && index($0, fs) == 0) next -- cgit v1.2.3 From c6acad5f8ccc81d092f4be09e0493b241e9a496b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 18 Feb 2016 22:06:54 +0200 Subject: Doc fix in Heisenberg Physics example. --- doc/ChangeLog | 2 ++ doc/gawk.info | 6 +++--- doc/gawk.texi | 6 +++--- doc/gawktexi.in | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 96f09650..6017ee44 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -4,6 +4,8 @@ dlward134@gmail.com. Added an example of use of rewind(), also per suggestion from David Ward. * gawktexi.in: Update info about Texinfo versions. + * gawktexi.in (Limitations): Fix Heisenberg Physics example and + spelling of Heisenberg's name. Thanks to Hermann Peifer. 2016-02-14 Arnold D. Robbins diff --git a/doc/gawk.info b/doc/gawk.info index 6c35a5f1..35484814 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -21991,7 +21991,7 @@ debug (the "debuggee", if you will). The 'gawk' debugger is different; it is an integrated part of 'gawk' itself. This makes it possible, in rare cases, for 'gawk' to become an -excellent demonstrator of Heisenburg Uncertainty physics, where the mere +excellent demonstrator of Heisenberg Uncertainty physics, where the mere act of observing something can change it. Consider the following:(1) $ cat test.awk @@ -22025,13 +22025,13 @@ under the debugger: -| main() at `test.awk':1 -| 1 { print typeof($1), typeof($2) } gawk> n Get result from typeof() - -| strnum string Result for $2 isn't right + -| strnum number Result for $2 isn't right -| Program exited normally with exit value: 0 gawk> quit In this case, the act of comparing the new value of '$2' with the old one caused 'gawk' to evaluate it and determine that it is indeed a -string, and this is reflected in the result of 'typeof()'. +number, and this is reflected in the result of 'typeof()'. Cases like this where the debugger is not transparent to the program's execution should be rare. If you encounter one, please report diff --git a/doc/gawk.texi b/doc/gawk.texi index 91d3d167..33a823bc 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -30526,7 +30526,7 @@ debug (the @dfn{debuggee}, if you will). The @command{gawk} debugger is different; it is an integrated part of @command{gawk} itself. This makes it possible, in rare cases, -for @command{gawk} to become an excellent demonstrator of Heisenburg +for @command{gawk} to become an excellent demonstrator of Heisenberg Uncertainty physics, where the mere act of observing something can change it. Consider the following:@footnote{Thanks to Hermann Peifer for this example.} @@ -30565,14 +30565,14 @@ gawk> @kbd{n} @ii{Keep going @dots{}} @print{} main() at `test.awk':1 @print{} 1 @{ print typeof($1), typeof($2) @} gawk> @kbd{n} @ii{Get result from} typeof() -@print{} strnum string @ii{Result for} $2 @ii{isn't right} +@print{} strnum number @ii{Result for} $2 @ii{isn't right} @print{} Program exited normally with exit value: 0 gawk> @kbd{quit} @end example In this case, the act of comparing the new value of @code{$2} with the old one caused @command{gawk} to evaluate it and determine that it -is indeed a string, and this is reflected in the result of +is indeed a number, and this is reflected in the result of @code{typeof()}. Cases like this where the debugger is not transparent to the program's diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 19c1217e..7c9d473e 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -29617,7 +29617,7 @@ debug (the @dfn{debuggee}, if you will). The @command{gawk} debugger is different; it is an integrated part of @command{gawk} itself. This makes it possible, in rare cases, -for @command{gawk} to become an excellent demonstrator of Heisenburg +for @command{gawk} to become an excellent demonstrator of Heisenberg Uncertainty physics, where the mere act of observing something can change it. Consider the following:@footnote{Thanks to Hermann Peifer for this example.} @@ -29656,14 +29656,14 @@ gawk> @kbd{n} @ii{Keep going @dots{}} @print{} main() at `test.awk':1 @print{} 1 @{ print typeof($1), typeof($2) @} gawk> @kbd{n} @ii{Get result from} typeof() -@print{} strnum string @ii{Result for} $2 @ii{isn't right} +@print{} strnum number @ii{Result for} $2 @ii{isn't right} @print{} Program exited normally with exit value: 0 gawk> @kbd{quit} @end example In this case, the act of comparing the new value of @code{$2} with the old one caused @command{gawk} to evaluate it and determine that it -is indeed a string, and this is reflected in the result of +is indeed a number, and this is reflected in the result of @code{typeof()}. Cases like this where the debugger is not transparent to the program's -- cgit v1.2.3