troubleshooting Question

Linux Script

Avatar of Jack_son_
Jack_son_Flag for Afghanistan asked on
LinuxLinux OS DevLinux Networking
7 Comments3 Solutions719 ViewsLast Modified:
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
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 3 Answers and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros