Is it possible to write an awk one-liner which will compare two fields on the same line to see if they are equal, and output the number of lines where this is true?I tried:awk '$1==$2 { print($1 $2); }' foo1 | wc -l     I don't think this is correct.
Count occurrences where two fields are equal
awk