Dears,
I've this assignment for my GF, n I absolutely have no clue abt Linux.
Can anyone help in makin this script.
. . . . . .................................... ............................................................................................................................................................
here it goes:
The student should write a bash program named fix-permissions.sh that accepts a list of users as 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.