I am trying to change the permissions for each directory in a path that a user will specify. This will be completed in a bash script. For example:
DIR = /a/b/c/d/e/f/
chmod 777 /a/b/c/d/e/f/
chmod 777 /a/b/c/d/e/
chmod 777 /a/b/c/d/
chmod 777 /a/b/c/
chmod 777 /a/b/
chmod 777 /a/
777 is only an example. Solution should allow for any permissions.
I do not want to change permissions of files within the directories and I can not assume these are the only sub-directories. I only want to change the permissions that are explicitly in the path given by the user.