~vcs-imports/gawk/master

« back to all changes in this revision

Viewing changes to awklib/eg/lib/nextfile.awk

  • Committer: Arnold D. Robbins
  • Date: 2010-07-16 09:41:09 UTC
  • Revision ID: git-v1:8c042f99cc7465c86351d21331a129111b75345d
Tags: gawk-3.0.0
Move to gawk-3.0.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# nextfile --- skip remaining records in current file
 
2
# correctly handle successive occurrences of the same file
 
3
# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
 
4
# May, 1993
 
5
 
 
6
# this should be read in before the "main" awk program
 
7
 
 
8
function nextfile()   { _abandon_ = FILENAME; next }
 
9
 
 
10
_abandon_ == FILENAME {
 
11
      if (FNR == 1)
 
12
          _abandon_ = ""
 
13
      else
 
14
          next
 
15
}