getline
Variants ¶Table 4.2
summarizes the eight variants of getline
,
listing which predefined variables are set by each one,
and whether the variant is standard or a gawk
extension.
Note: for each variant, gawk
sets the RT
predefined variable.
Variant | Effect | awk / gawk |
---|---|---|
getline | Sets $0 , NF , FNR , NR , and RT | awk |
getline var | Sets var, FNR , NR , and RT | awk |
getline < file | Sets $0 , NF , and RT | awk |
getline var < file | Sets var and RT | awk |
command | getline | Sets $0 , NF , and RT | awk |
command | getline var | Sets var and RT | awk |
command |& getline | Sets $0 , NF , and RT | gawk |
command |& getline var | Sets var and RT | gawk |