Previous: Getline Notes, Up: Getline



3.8.10 Summary of getline Variants

table-getline-variants summarizes the eight variants of getline, listing which built-in variables are set by each one.

Variant Effect
getline Sets $0, NF, FNR, and NR
getline var Sets var, FNR, and NR
getline < file Sets $0 and NF
getline var < file Sets var
command | getline Sets $0 and NF
command | getline var Sets var
command |& getline Sets $0 and NF. This is a gawk extension
command |& getline var Sets var. This is a gawk extension

Table 3.1: getline Variants and What They Set