diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-05-31 17:33:35 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-05-31 17:33:35 +0300 |
commit | b92de42c775ab615e2dd49aff0b66da4c2c31be4 (patch) | |
tree | 26a3eff957ed72cf1396a7bd372b16533543d8e6 | |
parent | f006165d77037b99e205496d8b79cb80e9f280c0 (diff) | |
download | egawk-b92de42c775ab615e2dd49aff0b66da4c2c31be4.tar.gz egawk-b92de42c775ab615e2dd49aff0b66da4c2c31be4.tar.bz2 egawk-b92de42c775ab615e2dd49aff0b66da4c2c31be4.zip |
Improve description of gensub().
-rw-r--r-- | doc/ChangeLog | 6 | ||||
-rw-r--r-- | doc/gawk.info | 791 | ||||
-rw-r--r-- | doc/gawk.texi | 11 | ||||
-rw-r--r-- | doc/gawktexi.in | 11 |
4 files changed, 414 insertions, 405 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog index 4b2fad9f..4d1e5a97 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,11 @@ 2018-05-31 Arnold D. Robbins <arnold@skeeve.com> + * gawktexi.in (String Functions): Clean up and clarify the + prose description of gensub(). Thanks to Andrew Schorr + for the encouragement (back in 2016...). + +2018-05-31 Arnold D. Robbins <arnold@skeeve.com> + * gawktexi.in (Extract Program): Additional bug fixes. Close the last file processed, and use the index of the for loop which is the filename as the argument to close()! diff --git a/doc/gawk.info b/doc/gawk.info index 14d4a7e7..0856e906 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -12633,10 +12633,11 @@ Options::): Search the target string TARGET for matches of the regular expression REGEXP. If HOW is a string beginning with 'g' or 'G' (short for "global"), then replace all matches of REGEXP with - REPLACEMENT. Otherwise, HOW is treated as a number indicating - which match of REGEXP to replace. If no TARGET is supplied, use - '$0'. It returns the modified string as the result of the function - and the original target string is _not_ changed. + REPLACEMENT. Otherwise, treat HOW as a number indicating which + match of REGEXP to replace. Treat numeric values less than one as + if they were one. If no TARGET is supplied, use '$0'. Return the + modified string as the result of the function. The original target + string is _not_ changed. 'gensub()' is a general substitution function. Its purpose is to provide more features than the standard 'sub()' and 'gsub()' @@ -32925,7 +32926,7 @@ Index * * (asterisk), * operator, as regexp operator: Regexp Operators. (line 89) * * (asterisk), * operator, null strings, matching: String Functions. - (line 539) + (line 540) * * (asterisk), ** operator: Arithmetic Ops. (line 81) * * (asterisk), ** operator <1>: Precedence. (line 48) * * (asterisk), **= operator: Assignment Ops. (line 129) @@ -33259,7 +33260,7 @@ Index (line 6) * array scanning order, controlling: Controlling Scanning. (line 14) -* array, number of elements: String Functions. (line 200) +* array, number of elements: String Functions. (line 201) * arrays: Arrays. (line 6) * arrays of arrays: Arrays of Arrays. (line 6) * arrays, an example of using: Array Example. (line 6) @@ -33324,7 +33325,7 @@ Index * asterisk (*), * operator, as regexp operator: Regexp Operators. (line 89) * asterisk (*), * operator, null strings, matching: String Functions. - (line 539) + (line 540) * asterisk (*), ** operator: Arithmetic Ops. (line 81) * asterisk (*), ** operator <1>: Precedence. (line 48) * asterisk (*), **= operator: Assignment Ops. (line 129) @@ -33547,7 +33548,7 @@ Index * Brian Kernighan's awk <8>: Continue Statement. (line 44) * Brian Kernighan's awk <9>: Nextfile Statement. (line 47) * Brian Kernighan's awk <10>: Delete. (line 51) -* Brian Kernighan's awk <11>: String Functions. (line 495) +* Brian Kernighan's awk <11>: String Functions. (line 496) * Brian Kernighan's awk <12>: Gory Details. (line 19) * Brian Kernighan's awk <13>: I/O Functions. (line 43) * Brian Kernighan's awk, extensions: BTL. (line 6) @@ -33590,7 +33591,7 @@ Index * case sensitivity, and regexps: User-modified. (line 79) * case sensitivity, and string comparisons: User-modified. (line 79) * case sensitivity, array indices and: Array Intro. (line 100) -* case sensitivity, converting case: String Functions. (line 525) +* case sensitivity, converting case: String Functions. (line 526) * case sensitivity, example programs: Library Functions. (line 53) * case sensitivity, gawk: Case-sensitivity. (line 26) * case sensitivity, regexps and: Case-sensitivity. (line 6) @@ -33671,7 +33672,7 @@ Index * common extensions, delete to delete entire arrays: Delete. (line 39) * common extensions, func keyword: Definition Syntax. (line 99) * common extensions, length() applied to an array: String Functions. - (line 200) + (line 201) * common extensions, RS as a regexp: gawk split records. (line 6) * common extensions, single character fields: Single Character Fields. (line 6) @@ -33724,9 +33725,9 @@ Index * control statements: Statements. (line 6) * controlling array scanning order: Controlling Scanning. (line 14) -* convert string to lower case: String Functions. (line 526) -* convert string to number: String Functions. (line 393) -* convert string to upper case: String Functions. (line 532) +* convert string to lower case: String Functions. (line 527) +* convert string to number: String Functions. (line 394) +* convert string to upper case: String Functions. (line 533) * converting integer array subscripts: Numeric Array Subscripts. (line 31) * converting, dates to timestamps: Time Functions. (line 78) @@ -33794,7 +33795,7 @@ Index (line 20) * dark corner, input files: awk split records. (line 110) * dark corner, invoking awk: Command Line. (line 16) -* dark corner, length() function: String Functions. (line 186) +* dark corner, length() function: String Functions. (line 187) * dark corner, locale's decimal point character: Locale influences conversions. (line 17) * dark corner, multiline records: Multiple Line. (line 35) @@ -33802,14 +33803,14 @@ Index * dark corner, OFMT variable: OFMT. (line 27) * dark corner, range patterns, line continuation and: Ranges. (line 64) * dark corner, regexp as second argument to index(): String Functions. - (line 164) + (line 165) * dark corner, regexp constants: Standard Regexp Constants. (line 6) * dark corner, regexp constants, /= operator and: Assignment Ops. (line 149) * dark corner, regexp constants, as arguments to user-defined functions: Standard Regexp Constants. (line 43) -* dark corner, split() function: String Functions. (line 363) +* dark corner, split() function: String Functions. (line 364) * dark corner, strings, storing: gawk split records. (line 82) * dark corner, value of ARGV[0]: Auto-set. (line 39) * dark corner, ^, in FS: Regexp Field Splitting. @@ -33957,7 +33958,7 @@ Index * deleting entire arrays: Delete. (line 39) * Demaille, Akim: Acknowledgments. (line 60) * describe call stack frame, in debugger: Debugger Info. (line 27) -* differences between gawk and awk: String Functions. (line 200) +* differences between gawk and awk: String Functions. (line 201) * differences in awk and gawk, ARGC/ARGV variables: ARGC and ARGV. (line 89) * differences in awk and gawk, ARGIND variable: Auto-set. (line 44) @@ -34006,7 +34007,7 @@ Index (line 34) * differences in awk and gawk, LINT variable: User-modified. (line 90) * differences in awk and gawk, match() function: String Functions. - (line 262) + (line 263) * differences in awk and gawk, print/printf statements: Format Modifiers. (line 13) * differences in awk and gawk, PROCINFO array: Auto-set. (line 148) @@ -34025,7 +34026,7 @@ Index * differences in awk and gawk, single-character fields: Single Character Fields. (line 6) * differences in awk and gawk, split() function: String Functions. - (line 350) + (line 351) * differences in awk and gawk, strings: Scalar Constants. (line 20) * differences in awk and gawk, strings, storing: gawk split records. (line 76) @@ -34213,7 +34214,7 @@ Index * extensions, common, fflush() function: I/O Functions. (line 43) * extensions, common, func keyword: Definition Syntax. (line 99) * extensions, common, length() applied to an array: String Functions. - (line 200) + (line 201) * extensions, common, RS as a regexp: gawk split records. (line 6) * extensions, common, single character fields: Single Character Fields. (line 6) @@ -34329,7 +34330,7 @@ Index * files, source, search path for: Programs Exercises. (line 70) * files, splitting: Split Program. (line 6) * files, Texinfo, extracting programs from: Extract Program. (line 6) -* find substring in string: String Functions. (line 155) +* find substring in string: String Functions. (line 156) * finding extensions: Finding Extensions. (line 6) * finish debugger command: Debugger Execution Control. (line 39) @@ -34366,7 +34367,7 @@ Index * format time string: Time Functions. (line 50) * formats, numeric output: OFMT. (line 6) * formatting output: Printf. (line 6) -* formatting strings: String Functions. (line 386) +* formatting strings: String Functions. (line 387) * forward slash (/) to enclose regular expressions: Regexp. (line 10) * forward slash (/), / operator: Precedence. (line 54) * forward slash (/), /= operator: Assignment Ops. (line 129) @@ -34639,8 +34640,8 @@ Index * groups, information about: Group Functions. (line 6) * gsub: Standard Regexp Constants. (line 43) -* gsub <1>: String Functions. (line 139) -* gsub() function, arguments of: String Functions. (line 465) +* gsub <1>: String Functions. (line 140) +* gsub() function, arguments of: String Functions. (line 466) * gsub() function, escape processing: Gory Details. (line 6) * Guerrero, Juan Manuel: Acknowledgments. (line 60) * Guerrero, Juan Manuel <1>: Contributors. (line 150) @@ -34704,7 +34705,7 @@ Index * in operator, use in loops: Scanning an Array. (line 17) * including files, @include directive: Include Files. (line 8) * increment operators: Increment Ops. (line 6) -* index: String Functions. (line 155) +* index: String Functions. (line 156) * indexing arrays: Array Intro. (line 48) * indirect function calls: Indirect Calls. (line 6) * indirect function calls, @-notation: Indirect Calls. (line 47) @@ -34724,7 +34725,7 @@ Index * input files, running awk without <1>: Read Terminal. (line 16) * input files, variable assignments and: Other Arguments. (line 26) * input pipeline: Getline/Pipe. (line 10) -* input record, length of: String Functions. (line 177) +* input record, length of: String Functions. (line 178) * input redirection: Getline/File. (line 6) * input, data, nondecimal: Nondecimal Data. (line 6) * input, explicit: Getline. (line 6) @@ -34826,9 +34827,9 @@ Index * left shift: Bitwise Functions. (line 47) * left shift, bitwise: Bitwise Functions. (line 32) * leftmost longest match: Multiple Line. (line 26) -* length: String Functions. (line 170) -* length of input record: String Functions. (line 177) -* length of string: String Functions. (line 170) +* length: String Functions. (line 171) +* length of input record: String Functions. (line 178) +* length of string: String Functions. (line 171) * Lesser General Public License (LGPL): Glossary. (line 489) * LGPL (Lesser General Public License): Glossary. (line 489) * libmawk: Other Versions. (line 130) @@ -34923,14 +34924,14 @@ Index (line 6) * marked strings, extracting: String Extraction. (line 6) * Marx, Groucho: Increment Ops. (line 60) -* match: String Functions. (line 210) -* match regexp in string: String Functions. (line 210) +* match: String Functions. (line 211) +* match regexp in string: String Functions. (line 211) * match() function, RSTART/RLENGTH variables: String Functions. - (line 227) + (line 228) * matching, expressions, See comparison expressions: Typing and Comparison. (line 9) * matching, leftmost longest: Multiple Line. (line 26) -* matching, null strings: String Functions. (line 539) +* matching, null strings: String Functions. (line 540) * mawk utility: Escape Sequences. (line 121) * mawk utility <1>: Getline/Pipe. (line 62) * mawk utility <2>: Concatenation. (line 36) @@ -35020,9 +35021,9 @@ Index (line 43) * null strings, converting numbers to strings: Strings And Numbers. (line 21) -* null strings, matching: String Functions. (line 539) +* null strings, matching: String Functions. (line 540) * number as string of bits: Bitwise Functions. (line 109) -* number of array elements: String Functions. (line 200) +* number of array elements: String Functions. (line 201) * number sign (#), #! (executable scripts): Executable Scripts. (line 6) * number sign (#), commenting: Comments. (line 6) @@ -35132,7 +35133,7 @@ Index * parentheses (), in a profile: Profiling. (line 146) * parentheses (), regexp operator: Regexp Operators. (line 81) * password file: Passwd Functions. (line 16) -* patsplit: String Functions. (line 296) +* patsplit: String Functions. (line 297) * patterns: Patterns and Actions. (line 6) * patterns, comparison expressions as: Expression Patterns. (line 14) @@ -35190,7 +35191,7 @@ Index * portability, gawk: New Ports. (line 6) * portability, gettext library and: Explaining gettext. (line 11) * portability, internationalization and: I18N Portability. (line 6) -* portability, length() function: String Functions. (line 179) +* portability, length() function: String Functions. (line 180) * portability, new awk vs. old awk: Strings And Numbers. (line 56) * portability, next statement in user-defined functions: Pass By Value/Reference. (line 88) @@ -35198,7 +35199,7 @@ Index * portability, operators: Increment Ops. (line 60) * portability, operators, not in POSIX awk: Precedence. (line 97) * portability, POSIXLY_CORRECT environment variable: Options. (line 376) -* portability, substr() function: String Functions. (line 515) +* portability, substr() function: String Functions. (line 516) * portable object files: Explaining gettext. (line 37) * portable object files <1>: Translator i18n. (line 6) * portable object files, converting to message object files: I18N Example. @@ -35233,7 +35234,7 @@ Index * POSIX awk, field separators and: Full Line Fields. (line 16) * POSIX awk, function keyword in: Definition Syntax. (line 99) * POSIX awk, functions and, gsub()/sub(): Gory Details. (line 90) -* POSIX awk, functions and, length(): String Functions. (line 179) +* POSIX awk, functions and, length(): String Functions. (line 180) * POSIX awk, GNU long options and: Options. (line 15) * POSIX awk, interval expressions in: Regexp Operators. (line 135) * POSIX awk, next/nextfile statements and: Next Statement. (line 44) @@ -35450,7 +35451,7 @@ Index * regular expressions, searching for: Egrep Program. (line 6) * relational operators, See comparison operators: Typing and Comparison. (line 9) -* replace in string: String Functions. (line 411) +* replace in string: String Functions. (line 412) * retrying input: Retrying Input. (line 6) * return debugger command: Debugger Execution Control. (line 54) @@ -35476,7 +35477,7 @@ Index * right shift, bitwise: Bitwise Functions. (line 32) * Ritchie, Dennis: Basic Data Typing. (line 54) * RLENGTH variable: Auto-set. (line 314) -* RLENGTH variable, match() function and: String Functions. (line 227) +* RLENGTH variable, match() function and: String Functions. (line 228) * Robbins, Arnold: Command Line Field Separator. (line 71) * Robbins, Arnold <1>: Getline/Pipe. (line 40) @@ -35504,7 +35505,7 @@ Index * RS variable, multiline records and: Multiple Line. (line 17) * rshift: Bitwise Functions. (line 54) * RSTART variable: Auto-set. (line 320) -* RSTART variable, match() function and: String Functions. (line 227) +* RSTART variable, match() function and: String Functions. (line 228) * RT variable: awk split records. (line 124) * RT variable <1>: Multiple Line. (line 130) * RT variable <2>: Auto-set. (line 327) @@ -35530,7 +35531,7 @@ Index * Schreiber, Bert: Acknowledgments. (line 38) * Schreiber, Rita: Acknowledgments. (line 38) * search and replace in strings: String Functions. (line 89) -* search in string: String Functions. (line 155) +* search in string: String Functions. (line 156) * search paths: Programs Exercises. (line 70) * search paths <1>: PC Using. (line 13) * search paths <2>: VMS Running. (line 57) @@ -35620,7 +35621,7 @@ Index (line 37) * sidebar, Interactive Versus Noninteractive Buffering: I/O Functions. (line 74) -* sidebar, Matching the Null String: String Functions. (line 537) +* sidebar, Matching the Null String: String Functions. (line 538) * sidebar, Operator Evaluation Order: Increment Ops. (line 58) * sidebar, Piping into sh: Redirection. (line 134) * sidebar, Pre-POSIX awk Used OFMT for String Conversion: Strings And Numbers. @@ -35692,13 +35693,13 @@ Index * source files, search path for: Programs Exercises. (line 70) * sparse arrays: Array Intro. (line 76) * Spencer, Henry: Glossary. (line 16) -* split: String Functions. (line 317) -* split string into array: String Functions. (line 296) +* split: String Functions. (line 318) +* split string into array: String Functions. (line 297) * split utility: Split Program. (line 6) * split() function, array elements, deleting: Delete. (line 61) * split.awk program: Split Program. (line 30) * sprintf: OFMT. (line 15) -* sprintf <1>: String Functions. (line 386) +* sprintf <1>: String Functions. (line 387) * sprintf() function, OFMT variable and: User-modified. (line 116) * sprintf() function, print/printf statements and: Round Function. (line 6) @@ -35734,16 +35735,16 @@ Index * string constants, vs. regexp constants: Computed Regexps. (line 40) * string extraction (internationalization): String Extraction. (line 6) -* string length: String Functions. (line 170) +* string length: String Functions. (line 171) * string operators: Concatenation. (line 9) -* string, regular expression match: String Functions. (line 210) +* string, regular expression match: String Functions. (line 211) * string-manipulation functions: String Functions. (line 6) * string-matching operators: Regexp Usage. (line 19) * string-translation functions: I18N Functions. (line 6) -* strings splitting, example: String Functions. (line 336) +* strings splitting, example: String Functions. (line 337) * strings, converting: Strings And Numbers. (line 6) * strings, converting <1>: Bitwise Functions. (line 109) -* strings, converting letter case: String Functions. (line 525) +* strings, converting letter case: String Functions. (line 526) * strings, converting, numbers to: User-modified. (line 30) * strings, converting, numbers to <1>: User-modified. (line 107) * strings, empty, See null strings: awk split records. (line 114) @@ -35754,13 +35755,13 @@ Index * strings, null: Regexp Field Splitting. (line 43) * strings, numeric: Variable Typing. (line 67) -* strtonum: String Functions. (line 393) +* strtonum: String Functions. (line 394) * strtonum() function (gawk), --non-decimal-data option and: Nondecimal Data. (line 35) * sub: Standard Regexp Constants. (line 43) -* sub <1>: String Functions. (line 411) -* sub() function, arguments of: String Functions. (line 465) +* sub <1>: String Functions. (line 412) +* sub() function, arguments of: String Functions. (line 466) * sub() function, escape processing: Gory Details. (line 6) * subscript separators: User-modified. (line 149) * subscripts in arrays, multidimensional: Multidimensional. (line 10) @@ -35774,8 +35775,8 @@ Index * SUBSEP variable, and multidimensional arrays: Multidimensional. (line 16) * substitute in string: String Functions. (line 89) -* substr: String Functions. (line 484) -* substring: String Functions. (line 484) +* substr: String Functions. (line 485) +* substring: String Functions. (line 485) * Sumner, Andrew: Other Versions. (line 73) * supplementary groups of gawk process: Auto-set. (line 271) * switch statement: Switch Statement. (line 6) @@ -35835,8 +35836,8 @@ Index * timestamps, converting dates to: Time Functions. (line 78) * timestamps, formatted: Getlocaltime Function. (line 6) -* tolower: String Functions. (line 526) -* toupper: String Functions. (line 532) +* tolower: String Functions. (line 527) +* toupper: String Functions. (line 533) * tr utility: Translate Program. (line 6) * trace debugger command: Miscellaneous Debugger Commands. (line 108) @@ -35862,8 +35863,8 @@ Index * troubleshooting, gawk, fatal errors, function arguments: Calling Built-in. (line 16) * troubleshooting, getline function: File Checking. (line 25) -* troubleshooting, gsub()/sub() functions: String Functions. (line 475) -* troubleshooting, match() function: String Functions. (line 291) +* troubleshooting, gsub()/sub() functions: String Functions. (line 476) +* troubleshooting, match() function: String Functions. (line 292) * troubleshooting, print statement, omitting commas: Print Examples. (line 30) * troubleshooting, printing: Redirection. (line 112) @@ -35872,7 +35873,7 @@ Index * troubleshooting, regexp constants vs. string constants: Computed Regexps. (line 40) * troubleshooting, string concatenation: Concatenation. (line 27) -* troubleshooting, substr() function: String Functions. (line 502) +* troubleshooting, substr() function: String Functions. (line 503) * troubleshooting, system() function: I/O Functions. (line 128) * troubleshooting, typographical errors, global variables: Options. (line 99) @@ -36274,339 +36275,339 @@ Ref: Numeric Functions-Footnote-1532480 Ref: Numeric Functions-Footnote-2532837 Ref: Numeric Functions-Footnote-3532885 Node: String Functions533157 -Ref: String Functions-Footnote-1556815 -Ref: String Functions-Footnote-2556943 -Ref: String Functions-Footnote-3557191 -Node: Gory Details557278 -Ref: table-sub-escapes559069 -Ref: table-sub-proposed560588 -Ref: table-posix-sub561951 -Ref: table-gensub-escapes563492 -Ref: Gory Details-Footnote-1564315 -Node: I/O Functions564469 -Ref: table-system-return-values570937 -Ref: I/O Functions-Footnote-1572917 -Ref: I/O Functions-Footnote-2573065 -Node: Time Functions573185 -Ref: Time Functions-Footnote-1583856 -Ref: Time Functions-Footnote-2583924 -Ref: Time Functions-Footnote-3584082 -Ref: Time Functions-Footnote-4584193 -Ref: Time Functions-Footnote-5584305 -Ref: Time Functions-Footnote-6584532 -Node: Bitwise Functions584798 -Ref: table-bitwise-ops585392 -Ref: Bitwise Functions-Footnote-1591455 -Ref: Bitwise Functions-Footnote-2591628 -Node: Type Functions591819 -Node: I18N Functions594570 -Node: User-defined596221 -Node: Definition Syntax597026 -Ref: Definition Syntax-Footnote-1602713 -Node: Function Example602784 -Ref: Function Example-Footnote-1605706 -Node: Function Caveats605728 -Node: Calling A Function606246 -Node: Variable Scope607204 -Node: Pass By Value/Reference610198 -Node: Return Statement613697 -Node: Dynamic Typing616676 -Node: Indirect Calls617606 -Ref: Indirect Calls-Footnote-1627858 -Node: Functions Summary627986 -Node: Library Functions630691 -Ref: Library Functions-Footnote-1634298 -Ref: Library Functions-Footnote-2634441 -Node: Library Names634612 -Ref: Library Names-Footnote-1638072 -Ref: Library Names-Footnote-2638295 -Node: General Functions638381 -Node: Strtonum Function639484 -Node: Assert Function642506 -Node: Round Function645832 -Node: Cliff Random Function647372 -Node: Ordinal Functions648388 -Ref: Ordinal Functions-Footnote-1651451 -Ref: Ordinal Functions-Footnote-2651703 -Node: Join Function651913 -Ref: Join Function-Footnote-1653683 -Node: Getlocaltime Function653883 -Node: Readfile Function657625 -Node: Shell Quoting659602 -Node: Data File Management661003 -Node: Filetrans Function661635 -Node: Rewind Function665731 -Node: File Checking667641 -Ref: File Checking-Footnote-1668975 -Node: Empty Files669176 -Node: Ignoring Assigns671155 -Node: Getopt Function672705 -Ref: Getopt Function-Footnote-1684174 -Node: Passwd Functions684374 -Ref: Passwd Functions-Footnote-1693213 -Node: Group Functions693301 -Ref: Group Functions-Footnote-1701199 -Node: Walking Arrays701406 -Node: Library Functions Summary704414 -Node: Library Exercises705820 -Node: Sample Programs706285 -Node: Running Examples707055 -Node: Clones707783 -Node: Cut Program709007 -Node: Egrep Program718936 -Ref: Egrep Program-Footnote-1726448 -Node: Id Program726558 -Node: Split Program730238 -Ref: Split Program-Footnote-1733696 -Node: Tee Program733825 -Node: Uniq Program736615 -Node: Wc Program744041 -Ref: Wc Program-Footnote-1748296 -Node: Miscellaneous Programs748390 -Node: Dupword Program749603 -Node: Alarm Program751633 -Node: Translate Program756488 -Ref: Translate Program-Footnote-1761053 -Node: Labels Program761323 -Ref: Labels Program-Footnote-1764674 -Node: Word Sorting764758 -Node: History Sorting768830 -Node: Extract Program770665 -Node: Simple Sed778785 -Node: Igawk Program781859 -Ref: Igawk Program-Footnote-1796190 -Ref: Igawk Program-Footnote-2796392 -Ref: Igawk Program-Footnote-3796514 -Node: Anagram Program796629 -Node: Signature Program799691 -Node: Programs Summary800938 -Node: Programs Exercises802152 -Ref: Programs Exercises-Footnote-1806281 -Node: Advanced Features806372 -Node: Nondecimal Data808362 -Node: Array Sorting809953 -Node: Controlling Array Traversal810653 -Ref: Controlling Array Traversal-Footnote-1819021 -Node: Array Sorting Functions819139 -Ref: Array Sorting Functions-Footnote-1824230 -Node: Two-way I/O824426 -Ref: Two-way I/O-Footnote-1830978 -Ref: Two-way I/O-Footnote-2831165 -Node: TCP/IP Networking831247 -Node: Profiling834365 -Ref: Profiling-Footnote-1843037 -Node: Advanced Features Summary843360 -Node: Internationalization845204 -Node: I18N and L10N846684 -Node: Explaining gettext847371 -Ref: Explaining gettext-Footnote-1853263 -Ref: Explaining gettext-Footnote-2853448 -Node: Programmer i18n853613 -Ref: Programmer i18n-Footnote-1858562 -Node: Translator i18n858611 -Node: String Extraction859405 -Ref: String Extraction-Footnote-1860537 -Node: Printf Ordering860623 -Ref: Printf Ordering-Footnote-1863409 -Node: I18N Portability863473 -Ref: I18N Portability-Footnote-1865929 -Node: I18N Example865992 -Ref: I18N Example-Footnote-1868798 -Node: Gawk I18N868871 -Node: I18N Summary869516 -Node: Debugger870857 -Node: Debugging871880 -Node: Debugging Concepts872321 -Node: Debugging Terms874130 -Node: Awk Debugging876705 -Node: Sample Debugging Session877611 -Node: Debugger Invocation878145 -Node: Finding The Bug879531 -Node: List of Debugger Commands886009 -Node: Breakpoint Control887342 -Node: Debugger Execution Control891036 -Node: Viewing And Changing Data894398 -Node: Execution Stack897772 -Node: Debugger Info899409 -Node: Miscellaneous Debugger Commands903480 -Node: Readline Support908542 -Node: Limitations909438 -Node: Debugging Summary911547 -Node: Arbitrary Precision Arithmetic912826 -Node: Computer Arithmetic914311 -Ref: table-numeric-ranges918077 -Ref: table-floating-point-ranges918570 -Ref: Computer Arithmetic-Footnote-1919228 -Node: Math Definitions919285 -Ref: table-ieee-formats922601 -Ref: Math Definitions-Footnote-1923204 -Node: MPFR features923309 -Node: FP Math Caution925027 -Ref: FP Math Caution-Footnote-1926099 -Node: Inexactness of computations926468 -Node: Inexact representation927428 -Node: Comparing FP Values928788 -Node: Errors accumulate929870 -Node: Getting Accuracy931303 -Node: Try To Round934013 -Node: Setting precision934912 -Ref: table-predefined-precision-strings935609 -Node: Setting the rounding mode937439 -Ref: table-gawk-rounding-modes937813 -Ref: Setting the rounding mode-Footnote-1941744 -Node: Arbitrary Precision Integers941923 -Ref: Arbitrary Precision Integers-Footnote-1945098 -Node: Checking for MPFR945247 -Node: POSIX Floating Point Problems946721 -Ref: POSIX Floating Point Problems-Footnote-1950592 -Node: Floating point summary950630 -Node: Dynamic Extensions952820 -Node: Extension Intro954373 -Node: Plugin License955639 -Node: Extension Mechanism Outline956436 -Ref: figure-load-extension956875 -Ref: figure-register-new-function958440 -Ref: figure-call-new-function959532 -Node: Extension API Description961594 -Node: Extension API Functions Introduction963236 -Node: General Data Types968776 -Ref: General Data Types-Footnote-1977137 -Node: Memory Allocation Functions977436 -Ref: Memory Allocation Functions-Footnote-1981646 -Node: Constructor Functions981745 -Node: Registration Functions985331 -Node: Extension Functions986016 -Node: Exit Callback Functions991231 -Node: Extension Version String992481 -Node: Input Parsers993144 -Node: Output Wrappers1005865 -Node: Two-way processors1010377 -Node: Printing Messages1012642 -Ref: Printing Messages-Footnote-11013813 -Node: Updating ERRNO1013966 -Node: Requesting Values1014705 -Ref: table-value-types-returned1015442 -Node: Accessing Parameters1016378 -Node: Symbol Table Access1017613 -Node: Symbol table by name1018125 -Node: Symbol table by cookie1019914 -Ref: Symbol table by cookie-Footnote-11024099 -Node: Cached values1024163 -Ref: Cached values-Footnote-11027699 -Node: Array Manipulation1027852 -Ref: Array Manipulation-Footnote-11028943 -Node: Array Data Types1028980 -Ref: Array Data Types-Footnote-11031638 -Node: Array Functions1031730 -Node: Flattening Arrays1036228 -Node: Creating Arrays1043204 -Node: Redirection API1047971 -Node: Extension API Variables1050804 -Node: Extension Versioning1051515 -Ref: gawk-api-version1051944 -Node: Extension GMP/MPFR Versioning1053675 -Node: Extension API Informational Variables1055303 -Node: Extension API Boilerplate1056376 -Node: Changes from API V11060350 -Node: Finding Extensions1061922 -Node: Extension Example1062481 -Node: Internal File Description1063279 -Node: Internal File Ops1067359 -Ref: Internal File Ops-Footnote-11078709 -Node: Using Internal File Ops1078849 -Ref: Using Internal File Ops-Footnote-11081232 -Node: Extension Samples1081506 -Node: Extension Sample File Functions1083035 -Node: Extension Sample Fnmatch1090684 -Node: Extension Sample Fork1092171 -Node: Extension Sample Inplace1093389 -Node: Extension Sample Ord1096606 -Node: Extension Sample Readdir1097442 -Ref: table-readdir-file-types1098331 -Node: Extension Sample Revout1099136 -Node: Extension Sample Rev2way1099725 -Node: Extension Sample Read write array1100465 -Node: Extension Sample Readfile1102407 -Node: Extension Sample Time1103502 -Node: Extension Sample API Tests1104850 -Node: gawkextlib1105342 -Node: Extension summary1108260 -Node: Extension Exercises1111962 -Node: Language History1113460 -Node: V7/SVR3.11115116 -Node: SVR41117268 -Node: POSIX1118702 -Node: BTL1120082 -Node: POSIX/GNU1120811 -Node: Feature History1126589 -Node: Common Extensions1142448 -Node: Ranges and Locales1143731 -Ref: Ranges and Locales-Footnote-11148347 -Ref: Ranges and Locales-Footnote-21148374 -Ref: Ranges and Locales-Footnote-31148609 -Node: Contributors1148830 -Node: History summary1154775 -Node: Installation1156155 -Node: Gawk Distribution1157099 -Node: Getting1157583 -Node: Extracting1158546 -Node: Distribution contents1160184 -Node: Unix Installation1166664 -Node: Quick Installation1167346 -Node: Shell Startup Files1169760 -Node: Additional Configuration Options1170849 -Node: Configuration Philosophy1173142 -Node: Non-Unix Installation1175511 -Node: PC Installation1175971 -Node: PC Binary Installation1176809 -Node: PC Compiling1177244 -Node: PC Using1178361 -Node: Cygwin1181576 -Node: MSYS1182675 -Node: VMS Installation1183176 -Node: VMS Compilation1183967 -Ref: VMS Compilation-Footnote-11185196 -Node: VMS Dynamic Extensions1185254 -Node: VMS Installation Details1186939 -Node: VMS Running1189192 -Node: VMS GNV1193471 -Node: VMS Old Gawk1194206 -Node: Bugs1194677 -Node: Bug address1195340 -Node: Usenet1198132 -Node: Maintainers1198909 -Node: Other Versions1200170 -Node: Installation summary1206932 -Node: Notes1208134 -Node: Compatibility Mode1208999 -Node: Additions1209781 -Node: Accessing The Source1210706 -Node: Adding Code1212143 -Node: New Ports1218362 -Node: Derived Files1222850 -Ref: Derived Files-Footnote-11228496 -Ref: Derived Files-Footnote-21228531 -Ref: Derived Files-Footnote-31229129 -Node: Future Extensions1229243 -Node: Implementation Limitations1229901 -Node: Extension Design1231084 -Node: Old Extension Problems1232238 -Ref: Old Extension Problems-Footnote-11233756 -Node: Extension New Mechanism Goals1233813 -Ref: Extension New Mechanism Goals-Footnote-11237177 -Node: Extension Other Design Decisions1237366 -Node: Extension Future Growth1239479 -Node: Old Extension Mechanism1240315 -Node: Notes summary1242078 -Node: Basic Concepts1243260 -Node: Basic High Level1243941 -Ref: figure-general-flow1244223 -Ref: figure-process-flow1244908 -Ref: Basic High Level-Footnote-11248209 -Node: Basic Data Typing1248394 -Node: Glossary1251722 -Node: Copying1283560 -Node: GNU Free Documentation License1321103 -Node: Index1346223 +Ref: String Functions-Footnote-1556866 +Ref: String Functions-Footnote-2556994 +Ref: String Functions-Footnote-3557242 +Node: Gory Details557329 +Ref: table-sub-escapes559120 +Ref: table-sub-proposed560639 +Ref: table-posix-sub562002 +Ref: table-gensub-escapes563543 +Ref: Gory Details-Footnote-1564366 +Node: I/O Functions564520 +Ref: table-system-return-values570988 +Ref: I/O Functions-Footnote-1572968 +Ref: I/O Functions-Footnote-2573116 +Node: Time Functions573236 +Ref: Time Functions-Footnote-1583907 +Ref: Time Functions-Footnote-2583975 +Ref: Time Functions-Footnote-3584133 +Ref: Time Functions-Footnote-4584244 +Ref: Time Functions-Footnote-5584356 +Ref: Time Functions-Footnote-6584583 +Node: Bitwise Functions584849 +Ref: table-bitwise-ops585443 +Ref: Bitwise Functions-Footnote-1591506 +Ref: Bitwise Functions-Footnote-2591679 +Node: Type Functions591870 +Node: I18N Functions594621 +Node: User-defined596272 +Node: Definition Syntax597077 +Ref: Definition Syntax-Footnote-1602764 +Node: Function Example602835 +Ref: Function Example-Footnote-1605757 +Node: Function Caveats605779 +Node: Calling A Function606297 +Node: Variable Scope607255 +Node: Pass By Value/Reference610249 +Node: Return Statement613748 +Node: Dynamic Typing616727 +Node: Indirect Calls617657 +Ref: Indirect Calls-Footnote-1627909 +Node: Functions Summary628037 +Node: Library Functions630742 +Ref: Library Functions-Footnote-1634349 +Ref: Library Functions-Footnote-2634492 +Node: Library Names634663 +Ref: Library Names-Footnote-1638123 +Ref: Library Names-Footnote-2638346 +Node: General Functions638432 +Node: Strtonum Function639535 +Node: Assert Function642557 +Node: Round Function645883 +Node: Cliff Random Function647423 +Node: Ordinal Functions648439 +Ref: Ordinal Functions-Footnote-1651502 +Ref: Ordinal Functions-Footnote-2651754 +Node: Join Function651964 +Ref: Join Function-Footnote-1653734 +Node: Getlocaltime Function653934 +Node: Readfile Function657676 +Node: Shell Quoting659653 +Node: Data File Management661054 +Node: Filetrans Function661686 +Node: Rewind Function665782 +Node: File Checking667692 +Ref: File Checking-Footnote-1669026 +Node: Empty Files669227 +Node: Ignoring Assigns671206 +Node: Getopt Function672756 +Ref: Getopt Function-Footnote-1684225 +Node: Passwd Functions684425 +Ref: Passwd Functions-Footnote-1693264 +Node: Group Functions693352 +Ref: Group Functions-Footnote-1701250 +Node: Walking Arrays701457 +Node: Library Functions Summary704465 +Node: Library Exercises705871 +Node: Sample Programs706336 +Node: Running Examples707106 +Node: Clones707834 +Node: Cut Program709058 +Node: Egrep Program718987 +Ref: Egrep Program-Footnote-1726499 +Node: Id Program726609 +Node: Split Program730289 +Ref: Split Program-Footnote-1733747 +Node: Tee Program733876 +Node: Uniq Program736666 +Node: Wc Program744092 +Ref: Wc Program-Footnote-1748347 +Node: Miscellaneous Programs748441 +Node: Dupword Program749654 +Node: Alarm Program751684 +Node: Translate Program756539 +Ref: Translate Program-Footnote-1761104 +Node: Labels Program761374 +Ref: Labels Program-Footnote-1764725 +Node: Word Sorting764809 +Node: History Sorting768881 +Node: Extract Program770716 +Node: Simple Sed778836 +Node: Igawk Program781910 +Ref: Igawk Program-Footnote-1796241 +Ref: Igawk Program-Footnote-2796443 +Ref: Igawk Program-Footnote-3796565 +Node: Anagram Program796680 +Node: Signature Program799742 +Node: Programs Summary800989 +Node: Programs Exercises802203 +Ref: Programs Exercises-Footnote-1806332 +Node: Advanced Features806423 +Node: Nondecimal Data808413 +Node: Array Sorting810004 +Node: Controlling Array Traversal810704 +Ref: Controlling Array Traversal-Footnote-1819072 +Node: Array Sorting Functions819190 +Ref: Array Sorting Functions-Footnote-1824281 +Node: Two-way I/O824477 +Ref: Two-way I/O-Footnote-1831029 +Ref: Two-way I/O-Footnote-2831216 +Node: TCP/IP Networking831298 +Node: Profiling834416 +Ref: Profiling-Footnote-1843088 +Node: Advanced Features Summary843411 +Node: Internationalization845255 +Node: I18N and L10N846735 +Node: Explaining gettext847422 +Ref: Explaining gettext-Footnote-1853314 +Ref: Explaining gettext-Footnote-2853499 +Node: Programmer i18n853664 +Ref: Programmer i18n-Footnote-1858613 +Node: Translator i18n858662 +Node: String Extraction859456 +Ref: String Extraction-Footnote-1860588 +Node: Printf Ordering860674 +Ref: Printf Ordering-Footnote-1863460 +Node: I18N Portability863524 +Ref: I18N Portability-Footnote-1865980 +Node: I18N Example866043 +Ref: I18N Example-Footnote-1868849 +Node: Gawk I18N868922 +Node: I18N Summary869567 +Node: Debugger870908 +Node: Debugging871931 +Node: Debugging Concepts872372 +Node: Debugging Terms874181 +Node: Awk Debugging876756 +Node: Sample Debugging Session877662 +Node: Debugger Invocation878196 +Node: Finding The Bug879582 +Node: List of Debugger Commands886060 +Node: Breakpoint Control887393 +Node: Debugger Execution Control891087 +Node: Viewing And Changing Data894449 +Node: Execution Stack897823 +Node: Debugger Info899460 +Node: Miscellaneous Debugger Commands903531 +Node: Readline Support908593 +Node: Limitations909489 +Node: Debugging Summary911598 +Node: Arbitrary Precision Arithmetic912877 +Node: Computer Arithmetic914362 +Ref: table-numeric-ranges918128 +Ref: table-floating-point-ranges918621 +Ref: Computer Arithmetic-Footnote-1919279 +Node: Math Definitions919336 +Ref: table-ieee-formats922652 +Ref: Math Definitions-Footnote-1923255 +Node: MPFR features923360 +Node: FP Math Caution925078 +Ref: FP Math Caution-Footnote-1926150 +Node: Inexactness of computations926519 +Node: Inexact representation927479 +Node: Comparing FP Values928839 +Node: Errors accumulate929921 +Node: Getting Accuracy931354 +Node: Try To Round934064 +Node: Setting precision934963 +Ref: table-predefined-precision-strings935660 +Node: Setting the rounding mode937490 +Ref: table-gawk-rounding-modes937864 +Ref: Setting the rounding mode-Footnote-1941795 +Node: Arbitrary Precision Integers941974 +Ref: Arbitrary Precision Integers-Footnote-1945149 +Node: Checking for MPFR945298 +Node: POSIX Floating Point Problems946772 +Ref: POSIX Floating Point Problems-Footnote-1950643 +Node: Floating point summary950681 +Node: Dynamic Extensions952871 +Node: Extension Intro954424 +Node: Plugin License955690 +Node: Extension Mechanism Outline956487 +Ref: figure-load-extension956926 +Ref: figure-register-new-function958491 +Ref: figure-call-new-function959583 +Node: Extension API Description961645 +Node: Extension API Functions Introduction963287 +Node: General Data Types968827 +Ref: General Data Types-Footnote-1977188 +Node: Memory Allocation Functions977487 +Ref: Memory Allocation Functions-Footnote-1981697 +Node: Constructor Functions981796 +Node: Registration Functions985382 +Node: Extension Functions986067 +Node: Exit Callback Functions991282 +Node: Extension Version String992532 +Node: Input Parsers993195 +Node: Output Wrappers1005916 +Node: Two-way processors1010428 +Node: Printing Messages1012693 +Ref: Printing Messages-Footnote-11013864 +Node: Updating ERRNO1014017 +Node: Requesting Values1014756 +Ref: table-value-types-returned1015493 +Node: Accessing Parameters1016429 +Node: Symbol Table Access1017664 +Node: Symbol table by name1018176 +Node: Symbol table by cookie1019965 +Ref: Symbol table by cookie-Footnote-11024150 +Node: Cached values1024214 +Ref: Cached values-Footnote-11027750 +Node: Array Manipulation1027903 +Ref: Array Manipulation-Footnote-11028994 +Node: Array Data Types1029031 +Ref: Array Data Types-Footnote-11031689 +Node: Array Functions1031781 +Node: Flattening Arrays1036279 +Node: Creating Arrays1043255 +Node: Redirection API1048022 +Node: Extension API Variables1050855 +Node: Extension Versioning1051566 +Ref: gawk-api-version1051995 +Node: Extension GMP/MPFR Versioning1053726 +Node: Extension API Informational Variables1055354 +Node: Extension API Boilerplate1056427 +Node: Changes from API V11060401 +Node: Finding Extensions1061973 +Node: Extension Example1062532 +Node: Internal File Description1063330 +Node: Internal File Ops1067410 +Ref: Internal File Ops-Footnote-11078760 +Node: Using Internal File Ops1078900 +Ref: Using Internal File Ops-Footnote-11081283 +Node: Extension Samples1081557 +Node: Extension Sample File Functions1083086 +Node: Extension Sample Fnmatch1090735 +Node: Extension Sample Fork1092222 +Node: Extension Sample Inplace1093440 +Node: Extension Sample Ord1096657 +Node: Extension Sample Readdir1097493 +Ref: table-readdir-file-types1098382 +Node: Extension Sample Revout1099187 +Node: Extension Sample Rev2way1099776 +Node: Extension Sample Read write array1100516 +Node: Extension Sample Readfile1102458 +Node: Extension Sample Time1103553 +Node: Extension Sample API Tests1104901 +Node: gawkextlib1105393 +Node: Extension summary1108311 +Node: Extension Exercises1112013 +Node: Language History1113511 +Node: V7/SVR3.11115167 +Node: SVR41117319 +Node: POSIX1118753 +Node: BTL1120133 +Node: POSIX/GNU1120862 +Node: Feature History1126640 +Node: Common Extensions1142499 +Node: Ranges and Locales1143782 +Ref: Ranges and Locales-Footnote-11148398 +Ref: Ranges and Locales-Footnote-21148425 +Ref: Ranges and Locales-Footnote-31148660 +Node: Contributors1148881 +Node: History summary1154826 +Node: Installation1156206 +Node: Gawk Distribution1157150 +Node: Getting1157634 +Node: Extracting1158597 +Node: Distribution contents1160235 +Node: Unix Installation1166715 +Node: Quick Installation1167397 +Node: Shell Startup Files1169811 +Node: Additional Configuration Options1170900 +Node: Configuration Philosophy1173193 +Node: Non-Unix Installation1175562 +Node: PC Installation1176022 +Node: PC Binary Installation1176860 +Node: PC Compiling1177295 +Node: PC Using1178412 +Node: Cygwin1181627 +Node: MSYS1182726 +Node: VMS Installation1183227 +Node: VMS Compilation1184018 +Ref: VMS Compilation-Footnote-11185247 +Node: VMS Dynamic Extensions1185305 +Node: VMS Installation Details1186990 +Node: VMS Running1189243 +Node: VMS GNV1193522 +Node: VMS Old Gawk1194257 +Node: Bugs1194728 +Node: Bug address1195391 +Node: Usenet1198183 +Node: Maintainers1198960 +Node: Other Versions1200221 +Node: Installation summary1206983 +Node: Notes1208185 +Node: Compatibility Mode1209050 +Node: Additions1209832 +Node: Accessing The Source1210757 +Node: Adding Code1212194 +Node: New Ports1218413 +Node: Derived Files1222901 +Ref: Derived Files-Footnote-11228547 +Ref: Derived Files-Footnote-21228582 +Ref: Derived Files-Footnote-31229180 +Node: Future Extensions1229294 +Node: Implementation Limitations1229952 +Node: Extension Design1231135 +Node: Old Extension Problems1232289 +Ref: Old Extension Problems-Footnote-11233807 +Node: Extension New Mechanism Goals1233864 +Ref: Extension New Mechanism Goals-Footnote-11237228 +Node: Extension Other Design Decisions1237417 +Node: Extension Future Growth1239530 +Node: Old Extension Mechanism1240366 +Node: Notes summary1242129 +Node: Basic Concepts1243311 +Node: Basic High Level1243992 +Ref: figure-general-flow1244274 +Ref: figure-process-flow1244959 +Ref: Basic High Level-Footnote-11248260 +Node: Basic Data Typing1248445 +Node: Glossary1251773 +Node: Copying1283611 +Node: GNU Free Documentation License1321154 +Node: Index1346274 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 0d4c49a3..bd4033a3 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -17955,11 +17955,12 @@ a[3] = "middle" @cindex substitute in string Search the target string @var{target} for matches of the regular expression @var{regexp}. If @var{how} is a string beginning with -@samp{g} or @samp{G} (short for ``global''), then replace all matches of @var{regexp} with -@var{replacement}. Otherwise, @var{how} is treated as a number indicating -which match of @var{regexp} to replace. If no @var{target} is supplied, -use @code{$0}. It returns the modified string as the result -of the function and the original target string is @emph{not} changed. +@samp{g} or @samp{G} (short for ``global''), then replace all matches +of @var{regexp} with @var{replacement}. Otherwise, treat @var{how} +as a number indicating which match of @var{regexp} to replace. Treat +numeric values less than one as if they were one. If no @var{target} +is supplied, use @code{$0}. Return the modified string as the result +of the function. The original target string is @emph{not} changed. @code{gensub()} is a general substitution function. Its purpose is to provide more features than the standard @code{sub()} and @code{gsub()} diff --git a/doc/gawktexi.in b/doc/gawktexi.in index e857747e..6dfe92b0 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -17227,11 +17227,12 @@ a[3] = "middle" @cindex substitute in string Search the target string @var{target} for matches of the regular expression @var{regexp}. If @var{how} is a string beginning with -@samp{g} or @samp{G} (short for ``global''), then replace all matches of @var{regexp} with -@var{replacement}. Otherwise, @var{how} is treated as a number indicating -which match of @var{regexp} to replace. If no @var{target} is supplied, -use @code{$0}. It returns the modified string as the result -of the function and the original target string is @emph{not} changed. +@samp{g} or @samp{G} (short for ``global''), then replace all matches +of @var{regexp} with @var{replacement}. Otherwise, treat @var{how} +as a number indicating which match of @var{regexp} to replace. Treat +numeric values less than one as if they were one. If no @var{target} +is supplied, use @code{$0}. Return the modified string as the result +of the function. The original target string is @emph{not} changed. @code{gensub()} is a general substitution function. Its purpose is to provide more features than the standard @code{sub()} and @code{gsub()} |