home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnuawk.zip / awklib / eg / lib / nextfile.awk < prev    next >
Text File  |  1997-03-15  |  388b  |  16 lines

  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. }
  16.