The Input/Output statements are as follows:
getline
$0
from next input record; set NF
, NR
, FNR
.
See section Explicit Input with getline
.
getline <file
$0
from next record of file; set NF
.
getline var
NR
, FNR
.
getline var <file
command | getline
getline
; sets $0
,
NF
, NR
.
command | getline var
getline
; sets var.
next
awk
program.
If the end of the input data is reached, the END
rule(s), if any,
are executed.
See section The next
Statement.
nextfile
FILENAME
is updated, FNR
is set to one,
ARGIND
is incremented,
and processing starts over with the first pattern in the awk
program.
If the end of the input data is reached, the END
rule(s), if any,
are executed.
Earlier versions of gawk
used `next file'; this usage is still
supported, but is considered to be deprecated.
See section The nextfile
Statement.
print
print expr-list
print expr-list > file
print
is executed.
print expr-list >> file
print
is appended to the file.
print expr-list | command
close
function
is called.
printf fmt, expr-list
printf fmt, expr-list > file
printf
is executed.
printf fmt, expr-list >> file
printf
is appended to the file.
printf fmt, expr-list | command
close
function
is called.
getline
returns zero on end of file, and -1 on an error.
In the event of an error, getline
will set ERRNO
to
the value of a system-dependent string that describes the error.
Go to the first, previous, next, last section, table of contents.