testman84 0 Newbie Poster

what I'm trying is to write program that accepts list of user as its argument
1- If a user or more are given as arguments, the script should reset files permissions as follows:
a. Directory ~/share to 750 (if it exists).
b. All regular files inside ~/share to 744.
c. All directories inside ~/share to 750.
d. All other regular files in ~ to 600 and all other directories in ~ to 700.
e. files of other types are left as they are.

We assume that there is only one level of files and directories inside ~ (except for ~/share), and there is only one level of files and directories inside ~/share.

2- If no arguments are give, the script should identify normal users in the system (UID >= 500) and for each user, reset files permissions as described above.

3- At the end of the execution, the script must produce a file named report.txt that contains a list of all files in the user's home directory including full path, owner, group and permissions for each file.

please help me if you can