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


4.9.10 Summary of getline Variants

Table 4.1 summarizes the eight variants of getline, listing which built-in variables are set by each one, and whether the variant is standard or a gawk extension. Note: for each variant, gawk sets the RT built-in variable.

VariantEffectStandard / Extension
getlineSets $0, NF, FNR, NR, and RTStandard
getline varSets var, FNR, NR, and RTStandard
getline < fileSets $0, NF, and RTStandard
getline var < fileSets var and RTStandard
command | getlineSets $0, NF, and RTStandard
command | getline varSets var and RTStandard
command |& getlineSets $0, NF, and RTExtension
command |& getline varSets var and RTExtension

Table 4.1: getline Variants and What They Set