I'm trying to add these requirements to my script below:
o The file owner can read, modify and access the scenario company directories
o The group members can read and access the scenario company directories
o Everyone else has no access.
· Create a file in each of the scenario company directories.
o Set the file permissions for the files in the scenario company directories.
o The owner can read and modify the file
o The group members can only read the file
o Everyone else has no permissions
10 #
11 # This will create the home ARI directory
12 #
13 #
14 test -d /ARI && echo ">ARI already exists" || mkdir -v /ARI
15 #
16 #
17 # Create Next level of Directories
18 test –d /ARI/SALES && echo “/ARI/SALES already exists” || mkdir –v /ARI/SALES
19 test –d /ARI/IT && echo “/ARI/IT already exists” || mkdir –v /ARI/IT
20 test –d /ARI/MARKETING && echo “/ARI/SALES already exists” || mkdir –v /ARI/MARKETING
21 test –d /ARI/FINANCE && echo “/ARI/SALES already exists” || mkdir –v /ARI/FINANCE
22 #
23 #
24 # The next lines create the subfolders under the second level directories
25 mkdir –v \ARI\SALES\REG_1
26 mkdir –v \ARI\SALES\REG_2
27 mkdir –v \ARI\SALES\REG_3
28 mkdir –v \ARI\IT\OPS
29 mkdir –v \ARI\IT\DEV
30 mkdir –v \ARI\IT\RandD
31 mkdir –v \ARI\MARKETING\FT
32 mkdir –v \ARI\MARKETING\PT
33 mkdir –v \ARI\MARKETING\CNT
34 mkdir –v \ARI\FINANCE\AP
35 mkdir –v \ARI\FINANCE\AR
36 mkdir –v \ARI\FINANCE\ADT
37 #
38 #
39 #Create symbolic links from OPS and PT subdirectories to their parent directory
40 ln-s /ARI/IT /IT/OPS
41 ln-s /ARI/MARKETING /MARKETING/PT
42 done
43 done
LinuxLinux NetworkingLinux OS Dev
Last Comment
Jack_son_
8/22/2022 - Mon
Kerem ERSOY
Hi,
Your requirements require you to customise directory and file permissions before running the script. It is not a part of the script.
A directory should have this if you want the owner can read write and group can read write and others won't have any permission:
Your requirements require you to customise directory and file permissions before running the script. It is not a part of the script.
A directory should have this if you want the owner can read write and group can read write and others won't have any permission:
Open in new window
While if ypu want the group can only read but can't write the directory should have this:
Open in new window
Cheers,
K.