This question already has an answer here:
I have two files with one column.
If the first rows in the two files are same, then print 1 otherwise print 0.
M A A M
M M A A
1 0 1 0
Can anybody show me an awk script which would do this?