For loop for seperate files

For shell script. If I had two separate files, file.txt and file1.txt and each has just a list of names from the who command. How would I create an if loop to compare each name?

You should be more specific in your details in what you mean by your phrase "compare each name".

What exactly do you want to compare?