The version of awk shipped with HP-UX is POSIX-complient
and I believe essentially a version of the AT&T Toolchest
nawk (new awk).
nawk does not support the nextfile keyword.
nextfile is a specific gawk extension.
See the GNU awk users guide (
www.gnu.org) for details
of how to implement nextfile as an awk function. The code
is as follows but you should read the full text to understand
side effects, etc.
# nextfile --- skip remaining records in current file
# correctly handle successive occurrences of the same file
# this should be read in before the "main" awk program
function nextfile() { _abandon_ = FILENAME; next }
_abandon_ == FILENAME {
if (FNR == 1)
_abandon_ = ""
else
next
}
- Finnbarr