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.

print $1) since you're just counting the lines.. – gokcehan Oct 26 '12 at 21:04print– Bernhard Nov 2 '12 at 8:48