What are NR and FNR and what does “NR==FNR” imply?

In awk, FNR refers to the record number (typically the line number) in the current file and NR refers to the total record number. The operator == is a comparison operator, which returns true when the two surrounding operands are equal. 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 … Read more