I have two different user lists. I need to compare the users and make sure they exist in both files. One is the passwd file, and another is a flat file for that has the usernames and other information that I can extract a sorted username list from.
This gives me a sorted list of the usernames:
cat /etc/passwd | cut --fields=1 | sort -k1.2
Is there a better way to do this number one, and number two how do I then compare it the other user list from the other file? If the user does not exist I will be adding it to the flat file.