aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/gawk.info496
-rw-r--r--doc/gawk.texi12
2 files changed, 257 insertions, 251 deletions
diff --git a/doc/gawk.info b/doc/gawk.info
index e344c401..70fb686b 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -8967,13 +8967,16 @@ implementations, or if `gawk' is in compatibility mode (*note
Options::), `nextfile' is not special.
Upon execution of the `nextfile' statement, any `ENDFILE' rules are
-executed, `FILENAME' is updated to the name of the next data file
-listed on the command line, `FNR' is reset to one, `ARGIND' is
-incremented, any `BEGINFILE' rules are executed, and processing starts
-over with the first rule in the program. (`ARGIND' hasn't been
-introduced yet. *Note Built-in Variables::.) If the `nextfile'
-statement causes the end of the input to be reached, then the code in
-any `END' rules is executed. *Note BEGIN/END::.
+executed except in the case as mentioned below, `FILENAME' is updated
+to the name of the next data file listed on the command line, `FNR' is
+reset to one, `ARGIND' is incremented, any `BEGINFILE' rules are
+executed, and processing starts over with the first rule in the program.
+(`ARGIND' hasn't been introduced yet. *Note Built-in Variables::.) If
+the `nextfile' statement causes the end of the input to be reached,
+then the code in any `END' rules is executed. An exception to this is
+when the `nextfile' is invoked during execution of any statement in an
+`END' rule; In this case, it causes the program to stop immediately.
+*Note BEGIN/END::.
The `nextfile' statement is useful when there are many data files to
process but it isn't necessary to process every record in every file.
@@ -8983,7 +8986,8 @@ accomplishes this much more efficiently.
In addition, `nextfile' is useful inside a `BEGINFILE' rule to skip
over a file that would otherwise cause `gawk' to exit with a fatal
-error. *Note BEGINFILE/ENDFILE::.
+error. In this case, `ENDFILE' rules are not executed. *Note
+BEGINFILE/ENDFILE::.
While one might think that `close(FILENAME)' would accomplish the
same as `nextfile', this isn't true. `close()' is reserved for closing
@@ -26008,7 +26012,7 @@ Index
* functions, user-defined, counts: Profiling. (line 132)
* functions, user-defined, library of: Library Functions. (line 6)
* functions, user-defined, next/nextfile statements and <1>: Nextfile Statement.
- (line 40)
+ (line 44)
* functions, user-defined, next/nextfile statements and: Next Statement.
(line 45)
* G-d: Acknowledgments. (line 81)
@@ -26522,7 +26526,7 @@ Index
* nextfile statement, BEGINFILE/ENDFILE patterns and: BEGINFILE/ENDFILE.
(line 26)
* nextfile statement, user-defined functions and: Nextfile Statement.
- (line 40)
+ (line 44)
* nexti debugger command: Dgawk Execution Control.
(line 49)
* NF variable <1>: Auto-set. (line 107)
@@ -27622,241 +27626,241 @@ Node: Break Statement374114
Node: Continue Statement376104
Node: Next Statement377891
Node: Nextfile Statement380281
-Node: Exit Statement382578
-Node: Built-in Variables384994
-Node: User-modified386089
-Ref: User-modified-Footnote-1394115
-Node: Auto-set394177
-Ref: Auto-set-Footnote-1403468
-Node: ARGC and ARGV403673
-Node: Arrays407524
-Node: Array Basics409029
-Node: Array Intro409740
-Node: Reference to Elements414058
-Node: Assigning Elements416328
-Node: Array Example416819
-Node: Scanning an Array418551
-Node: Delete421217
-Ref: Delete-Footnote-1423652
-Node: Numeric Array Subscripts423709
-Node: Uninitialized Subscripts425892
-Node: Multi-dimensional427520
-Node: Multi-scanning430614
-Node: Arrays of Arrays432198
-Node: Functions436775
-Node: Built-in437597
-Node: Calling Built-in438675
-Node: Numeric Functions440663
-Ref: Numeric Functions-Footnote-1444428
-Ref: Numeric Functions-Footnote-2444785
-Ref: Numeric Functions-Footnote-3444833
-Node: String Functions445102
-Ref: String Functions-Footnote-1468599
-Ref: String Functions-Footnote-2468728
-Ref: String Functions-Footnote-3468976
-Node: Gory Details469063
-Ref: table-sub-escapes470742
-Ref: table-sub-posix-92472096
-Ref: table-sub-proposed473439
-Ref: table-posix-sub474789
-Ref: table-gensub-escapes476335
-Ref: Gory Details-Footnote-1477542
-Ref: Gory Details-Footnote-2477593
-Node: I/O Functions477744
-Ref: I/O Functions-Footnote-1484399
-Node: Time Functions484546
-Ref: Time Functions-Footnote-1495438
-Ref: Time Functions-Footnote-2495506
-Ref: Time Functions-Footnote-3495664
-Ref: Time Functions-Footnote-4495775
-Ref: Time Functions-Footnote-5495887
-Ref: Time Functions-Footnote-6496114
-Node: Bitwise Functions496380
-Ref: table-bitwise-ops496938
-Ref: Bitwise Functions-Footnote-1501098
-Node: Type Functions501282
-Node: I18N Functions501752
-Node: User-defined503379
-Node: Definition Syntax504183
-Ref: Definition Syntax-Footnote-1509093
-Node: Function Example509162
-Node: Function Caveats511756
-Node: Calling A Function512177
-Node: Variable Scope513292
-Node: Pass By Value/Reference515267
-Node: Return Statement518707
-Node: Dynamic Typing521688
-Node: Indirect Calls522423
-Node: Internationalization532108
-Node: I18N and L10N533534
-Node: Explaining gettext534220
-Ref: Explaining gettext-Footnote-1539286
-Ref: Explaining gettext-Footnote-2539470
-Node: Programmer i18n539635
-Node: Translator i18n543835
-Node: String Extraction544628
-Ref: String Extraction-Footnote-1545589
-Node: Printf Ordering545675
-Ref: Printf Ordering-Footnote-1548459
-Node: I18N Portability548523
-Ref: I18N Portability-Footnote-1550972
-Node: I18N Example551035
-Ref: I18N Example-Footnote-1553670
-Node: Gawk I18N553742
-Node: Advanced Features554359
-Node: Nondecimal Data555872
-Node: Array Sorting557455
-Node: Controlling Array Traversal558155
-Node: Controlling Scanning With A Function558902
-Node: Controlling Scanning566605
-Ref: Controlling Scanning-Footnote-1570406
-Node: Array Sorting Functions570722
-Ref: Array Sorting Functions-Footnote-1574238
-Ref: Array Sorting Functions-Footnote-2574331
-Node: Two-way I/O574525
-Ref: Two-way I/O-Footnote-1579957
-Node: TCP/IP Networking580027
-Node: Profiling582871
-Node: Library Functions590345
-Ref: Library Functions-Footnote-1593352
-Node: Library Names593523
-Ref: Library Names-Footnote-1596994
-Ref: Library Names-Footnote-2597214
-Node: General Functions597300
-Node: Strtonum Function598253
-Node: Assert Function601183
-Node: Round Function604509
-Node: Cliff Random Function606052
-Node: Ordinal Functions607068
-Ref: Ordinal Functions-Footnote-1610138
-Ref: Ordinal Functions-Footnote-2610390
-Node: Join Function610599
-Ref: Join Function-Footnote-1612370
-Node: Gettimeofday Function612570
-Node: Data File Management616285
-Node: Filetrans Function616917
-Node: Rewind Function621056
-Node: File Checking622443
-Node: Empty Files623537
-Node: Ignoring Assigns625767
-Node: Getopt Function627320
-Ref: Getopt Function-Footnote-1638624
-Node: Passwd Functions638827
-Ref: Passwd Functions-Footnote-1647802
-Node: Group Functions647890
-Node: Walking Arrays655974
-Node: Sample Programs657543
-Node: Running Examples658208
-Node: Clones658936
-Node: Cut Program660160
-Node: Egrep Program670005
-Ref: Egrep Program-Footnote-1677778
-Node: Id Program677888
-Node: Split Program681504
-Ref: Split Program-Footnote-1685023
-Node: Tee Program685151
-Node: Uniq Program687954
-Node: Wc Program695383
-Ref: Wc Program-Footnote-1699649
-Ref: Wc Program-Footnote-2699849
-Node: Miscellaneous Programs699941
-Node: Dupword Program701129
-Node: Alarm Program703160
-Node: Translate Program707909
-Ref: Translate Program-Footnote-1712296
-Ref: Translate Program-Footnote-2712524
-Node: Labels Program712658
-Ref: Labels Program-Footnote-1716029
-Node: Word Sorting716113
-Node: History Sorting719997
-Node: Extract Program721836
-Ref: Extract Program-Footnote-1729319
-Node: Simple Sed729447
-Node: Igawk Program732509
-Ref: Igawk Program-Footnote-1747666
-Ref: Igawk Program-Footnote-2747867
-Node: Anagram Program748005
-Node: Signature Program751073
-Node: Debugger752173
-Node: Debugging753084
-Node: Debugging Concepts753497
-Node: Debugging Terms755353
-Node: Awk Debugging757976
-Node: Sample dgawk session758868
-Node: dgawk invocation759360
-Node: Finding The Bug760542
-Node: List of Debugger Commands767028
-Node: Breakpoint Control768339
-Node: Dgawk Execution Control771975
-Node: Viewing And Changing Data775326
-Node: Dgawk Stack778663
-Node: Dgawk Info780123
-Node: Miscellaneous Dgawk Commands784071
-Node: Readline Support789499
-Node: Dgawk Limitations790337
-Node: Language History792526
-Node: V7/SVR3.1794038
-Node: SVR4796359
-Node: POSIX797801
-Node: BTL798809
-Node: POSIX/GNU799543
-Node: Common Extensions804694
-Node: Ranges and Locales805801
-Ref: Ranges and Locales-Footnote-1810408
-Node: Contributors810629
-Node: Installation814891
-Node: Gawk Distribution815785
-Node: Getting816269
-Node: Extracting817095
-Node: Distribution contents818787
-Node: Unix Installation824009
-Node: Quick Installation824626
-Node: Additional Configuration Options826588
-Node: Configuration Philosophy828065
-Node: Non-Unix Installation830407
-Node: PC Installation830865
-Node: PC Binary Installation832164
-Node: PC Compiling834012
-Node: PC Testing836956
-Node: PC Using838132
-Node: Cygwin842317
-Node: MSYS843317
-Node: VMS Installation843831
-Node: VMS Compilation844434
-Ref: VMS Compilation-Footnote-1845441
-Node: VMS Installation Details845499
-Node: VMS Running847134
-Node: VMS Old Gawk848741
-Node: Bugs849215
-Node: Other Versions853068
-Node: Notes858349
-Node: Compatibility Mode859041
-Node: Additions859824
-Node: Accessing The Source860636
-Node: Adding Code862061
-Node: New Ports868028
-Node: Dynamic Extensions872141
-Node: Internals873517
-Node: Plugin License882620
-Node: Sample Library883254
-Node: Internal File Description883940
-Node: Internal File Ops887655
-Ref: Internal File Ops-Footnote-1892436
-Node: Using Internal File Ops892576
-Node: Future Extensions894953
-Node: Basic Concepts897457
-Node: Basic High Level898214
-Ref: Basic High Level-Footnote-1902249
-Node: Basic Data Typing902434
-Node: Floating Point Issues906959
-Node: String Conversion Precision908042
-Ref: String Conversion Precision-Footnote-1909742
-Node: Unexpected Results909851
-Node: POSIX Floating Point Problems911677
-Ref: POSIX Floating Point Problems-Footnote-1915382
-Node: Glossary915420
-Node: Copying940396
-Node: GNU Free Documentation License977953
-Node: Index1003090
+Node: Exit Statement382826
+Node: Built-in Variables385242
+Node: User-modified386337
+Ref: User-modified-Footnote-1394363
+Node: Auto-set394425
+Ref: Auto-set-Footnote-1403716
+Node: ARGC and ARGV403921
+Node: Arrays407772
+Node: Array Basics409277
+Node: Array Intro409988
+Node: Reference to Elements414306
+Node: Assigning Elements416576
+Node: Array Example417067
+Node: Scanning an Array418799
+Node: Delete421465
+Ref: Delete-Footnote-1423900
+Node: Numeric Array Subscripts423957
+Node: Uninitialized Subscripts426140
+Node: Multi-dimensional427768
+Node: Multi-scanning430862
+Node: Arrays of Arrays432446
+Node: Functions437023
+Node: Built-in437845
+Node: Calling Built-in438923
+Node: Numeric Functions440911
+Ref: Numeric Functions-Footnote-1444676
+Ref: Numeric Functions-Footnote-2445033
+Ref: Numeric Functions-Footnote-3445081
+Node: String Functions445350
+Ref: String Functions-Footnote-1468847
+Ref: String Functions-Footnote-2468976
+Ref: String Functions-Footnote-3469224
+Node: Gory Details469311
+Ref: table-sub-escapes470990
+Ref: table-sub-posix-92472344
+Ref: table-sub-proposed473687
+Ref: table-posix-sub475037
+Ref: table-gensub-escapes476583
+Ref: Gory Details-Footnote-1477790
+Ref: Gory Details-Footnote-2477841
+Node: I/O Functions477992
+Ref: I/O Functions-Footnote-1484647
+Node: Time Functions484794
+Ref: Time Functions-Footnote-1495686
+Ref: Time Functions-Footnote-2495754
+Ref: Time Functions-Footnote-3495912
+Ref: Time Functions-Footnote-4496023
+Ref: Time Functions-Footnote-5496135
+Ref: Time Functions-Footnote-6496362
+Node: Bitwise Functions496628
+Ref: table-bitwise-ops497186
+Ref: Bitwise Functions-Footnote-1501346
+Node: Type Functions501530
+Node: I18N Functions502000
+Node: User-defined503627
+Node: Definition Syntax504431
+Ref: Definition Syntax-Footnote-1509341
+Node: Function Example509410
+Node: Function Caveats512004
+Node: Calling A Function512425
+Node: Variable Scope513540
+Node: Pass By Value/Reference515515
+Node: Return Statement518955
+Node: Dynamic Typing521936
+Node: Indirect Calls522671
+Node: Internationalization532356
+Node: I18N and L10N533782
+Node: Explaining gettext534468
+Ref: Explaining gettext-Footnote-1539534
+Ref: Explaining gettext-Footnote-2539718
+Node: Programmer i18n539883
+Node: Translator i18n544083
+Node: String Extraction544876
+Ref: String Extraction-Footnote-1545837
+Node: Printf Ordering545923
+Ref: Printf Ordering-Footnote-1548707
+Node: I18N Portability548771
+Ref: I18N Portability-Footnote-1551220
+Node: I18N Example551283
+Ref: I18N Example-Footnote-1553918
+Node: Gawk I18N553990
+Node: Advanced Features554607
+Node: Nondecimal Data556120
+Node: Array Sorting557703
+Node: Controlling Array Traversal558403
+Node: Controlling Scanning With A Function559150
+Node: Controlling Scanning566853
+Ref: Controlling Scanning-Footnote-1570654
+Node: Array Sorting Functions570970
+Ref: Array Sorting Functions-Footnote-1574486
+Ref: Array Sorting Functions-Footnote-2574579
+Node: Two-way I/O574773
+Ref: Two-way I/O-Footnote-1580205
+Node: TCP/IP Networking580275
+Node: Profiling583119
+Node: Library Functions590593
+Ref: Library Functions-Footnote-1593600
+Node: Library Names593771
+Ref: Library Names-Footnote-1597242
+Ref: Library Names-Footnote-2597462
+Node: General Functions597548
+Node: Strtonum Function598501
+Node: Assert Function601431
+Node: Round Function604757
+Node: Cliff Random Function606300
+Node: Ordinal Functions607316
+Ref: Ordinal Functions-Footnote-1610386
+Ref: Ordinal Functions-Footnote-2610638
+Node: Join Function610847
+Ref: Join Function-Footnote-1612618
+Node: Gettimeofday Function612818
+Node: Data File Management616533
+Node: Filetrans Function617165
+Node: Rewind Function621304
+Node: File Checking622691
+Node: Empty Files623785
+Node: Ignoring Assigns626015
+Node: Getopt Function627568
+Ref: Getopt Function-Footnote-1638872
+Node: Passwd Functions639075
+Ref: Passwd Functions-Footnote-1648050
+Node: Group Functions648138
+Node: Walking Arrays656222
+Node: Sample Programs657791
+Node: Running Examples658456
+Node: Clones659184
+Node: Cut Program660408
+Node: Egrep Program670253
+Ref: Egrep Program-Footnote-1678026
+Node: Id Program678136
+Node: Split Program681752
+Ref: Split Program-Footnote-1685271
+Node: Tee Program685399
+Node: Uniq Program688202
+Node: Wc Program695631
+Ref: Wc Program-Footnote-1699897
+Ref: Wc Program-Footnote-2700097
+Node: Miscellaneous Programs700189
+Node: Dupword Program701377
+Node: Alarm Program703408
+Node: Translate Program708157
+Ref: Translate Program-Footnote-1712544
+Ref: Translate Program-Footnote-2712772
+Node: Labels Program712906
+Ref: Labels Program-Footnote-1716277
+Node: Word Sorting716361
+Node: History Sorting720245
+Node: Extract Program722084
+Ref: Extract Program-Footnote-1729567
+Node: Simple Sed729695
+Node: Igawk Program732757
+Ref: Igawk Program-Footnote-1747914
+Ref: Igawk Program-Footnote-2748115
+Node: Anagram Program748253
+Node: Signature Program751321
+Node: Debugger752421
+Node: Debugging753332
+Node: Debugging Concepts753745
+Node: Debugging Terms755601
+Node: Awk Debugging758224
+Node: Sample dgawk session759116
+Node: dgawk invocation759608
+Node: Finding The Bug760790
+Node: List of Debugger Commands767276
+Node: Breakpoint Control768587
+Node: Dgawk Execution Control772223
+Node: Viewing And Changing Data775574
+Node: Dgawk Stack778911
+Node: Dgawk Info780371
+Node: Miscellaneous Dgawk Commands784319
+Node: Readline Support789747
+Node: Dgawk Limitations790585
+Node: Language History792774
+Node: V7/SVR3.1794286
+Node: SVR4796607
+Node: POSIX798049
+Node: BTL799057
+Node: POSIX/GNU799791
+Node: Common Extensions804942
+Node: Ranges and Locales806049
+Ref: Ranges and Locales-Footnote-1810656
+Node: Contributors810877
+Node: Installation815139
+Node: Gawk Distribution816033
+Node: Getting816517
+Node: Extracting817343
+Node: Distribution contents819035
+Node: Unix Installation824257
+Node: Quick Installation824874
+Node: Additional Configuration Options826836
+Node: Configuration Philosophy828313
+Node: Non-Unix Installation830655
+Node: PC Installation831113
+Node: PC Binary Installation832412
+Node: PC Compiling834260
+Node: PC Testing837204
+Node: PC Using838380
+Node: Cygwin842565
+Node: MSYS843565
+Node: VMS Installation844079
+Node: VMS Compilation844682
+Ref: VMS Compilation-Footnote-1845689
+Node: VMS Installation Details845747
+Node: VMS Running847382
+Node: VMS Old Gawk848989
+Node: Bugs849463
+Node: Other Versions853316
+Node: Notes858597
+Node: Compatibility Mode859289
+Node: Additions860072
+Node: Accessing The Source860884
+Node: Adding Code862309
+Node: New Ports868276
+Node: Dynamic Extensions872389
+Node: Internals873765
+Node: Plugin License882868
+Node: Sample Library883502
+Node: Internal File Description884188
+Node: Internal File Ops887903
+Ref: Internal File Ops-Footnote-1892684
+Node: Using Internal File Ops892824
+Node: Future Extensions895201
+Node: Basic Concepts897705
+Node: Basic High Level898462
+Ref: Basic High Level-Footnote-1902497
+Node: Basic Data Typing902682
+Node: Floating Point Issues907207
+Node: String Conversion Precision908290
+Ref: String Conversion Precision-Footnote-1909990
+Node: Unexpected Results910099
+Node: POSIX Floating Point Problems911925
+Ref: POSIX Floating Point Problems-Footnote-1915630
+Node: Glossary915668
+Node: Copying940644
+Node: GNU Free Documentation License978201
+Node: Index1003338

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 87d8ff2e..9dbd45c0 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -12161,16 +12161,17 @@ or if @command{gawk} is in compatibility mode
@code{nextfile} is not special.
Upon execution of the @code{nextfile} statement,
-any @code{ENDFILE} rules are executed,
-@code{FILENAME} is
+any @code{ENDFILE} rules are executed except in the case as
+mentioned below, @code{FILENAME} is
updated to the name of the next @value{DF} listed on the command line,
@code{FNR} is reset to one, @code{ARGIND} is incremented,
any @code{BEGINFILE} rules are executed, and processing
starts over with the first rule in the program.
(@code{ARGIND} hasn't been introduced yet. @xref{Built-in Variables}.)
If the @code{nextfile} statement causes the end of the input to be reached,
-then the code in any @code{END} rules is executed.
-@xref{BEGIN/END}.
+then the code in any @code{END} rules is executed. An exception to this is
+when the @code{nextfile} is invoked during execution of any statement in an
+@code{END} rule; In this case, it causes the program to stop immediately. @xref{BEGIN/END}.
The @code{nextfile} statement is useful when there are many @value{DF}s
to process but it isn't necessary to process every record in every file.
@@ -12180,7 +12181,8 @@ statement accomplishes this much more efficiently.
In addition, @code{nextfile} is useful inside a @code{BEGINFILE}
rule to skip over a file that would otherwise cause @command{gawk}
-to exit with a fatal error. @xref{BEGINFILE/ENDFILE}.
+to exit with a fatal error. In this case, @code{ENDFILE} rules are not
+executed. @xref{BEGINFILE/ENDFILE}.
While one might think that @samp{close(FILENAME)} would accomplish
the same as @code{nextfile}, this isn't true. @code{close()} is