Question: what is fnr in awk?
Answer: In awk, FNR refers to the record number (typically the line number) in the current file and NR refers to the total record number. ... This means that the condition NR==FNR is only true for the first file, as FNR resets back to 1 for the first line of each file but NR keeps on increasing.