help about user sorting

Hi Folks,

I need help in script idea, i have 5 users and there home directories are

/home/user1
/home/user2
/home/user3
/home/user4
/home/user5
/home/user5

In each user there is a file xyz.txt and abcd.txt.

I have two objectives.

  1. sort those user have xyz.txt and abcd.txt not exist.
  2. sort those user have xyz.txt and abcd.txt exist but there own and group is differnet.

Thanks,
Bash

Since you want to check ownership.. of user etc...
You would write a script using a loop (while or for, your choice...)
which would

 1)  load UID/GID
 2)  write to a file  the username (UID/GID) if files not found
         else
     #check UID/GID 
        if different 
           write to another file...
        fi
     fi

Thanks for your suggestion, but if file is not there like abcd.txt or any file not there then script will not work properly what is your advice how i check if is there or not, can you shed a light on it pls.

Thanks,
Bash