Previous: , Up: Getline   [Contents][Index]


4.10.10 Summary of getline Variants

Table 4.1 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.

VariantEffectawk / gawk
getlineSets $0, NF, FNR, NR, and RTawk
getline varSets var, FNR, NR, and RTawk
getline < fileSets $0, NF, and RTawk
getline var < fileSets var and RTawk
command | getlineSets $0, NF, and RTawk
command | getline varSets var and RTawk
command |& getlineSets $0, NF, and RTgawk
command |& getline varSets var and RTgawk

Table 4.1: getline variants and what they set