Using bash or Python how do you :
- Specify a baseline directory (dir-a)
- Compare the contents to another directory (dir-b)
- Where a file/dir exists in both dir-a and dir-b set permissions of the dir-b file to match the permissions of dir-a
So in the following directories (and their child directories) where one file/dir matches another (eg ./SVN_SANDBOX/db and ./SVN_TEST1/db) I'd like to set the permissions for ./SVN_SANDBOX/db to be made equal to those for ./SVN_TEST1/db
glauc@foofoofo:~/devadmin/svn/SVN_SANDBOX$ ls -l
total 28
dr-xr-xr-x 2 glauc glauc 4096 Jul 2 21:16 conf
dr-xr-xr-x 2 glauc glauc 4096 Jul 2 21:16 dav
dr-xr-xr-x 5 glauc glauc 4096 Jul 2 21:16 db
-r--r--r-- 1 glauc glauc 2 Jul 2 21:16 format
dr-xr-xr-x 2 glauc glauc 4096 Jul 2 21:16 hooks
dr-xr-xr-x 2 glauc glauc 4096 Jul 2 21:16 locks
-r--r--r-- 1 glauc glauc 234 Jul 2 21:16 README.txt
glauc@foofoofo:~/devadmin/svn/SVN_SANDBOX$ cd ../SVN_TEST1
glauc@foofoofo:~/devadmin/svn/SVN_TEST1$ ls -l
total 24
drwxrwxr-x 2 glauc glauc 4096 Jul 2 21:23 conf
drwxrwsr-x 6 glauc glauc 4096 Jul 2 21:23 db
-r--r--r-- 1 glauc glauc 2 Jul 2 21:23 format
drwxrwxr-x 2 glauc glauc 4096 Jul 2 21:23 hooks
drwxrwxr-x 2 glauc glauc 4096 Jul 2 21:23 locks
-rw-rw-r-- 1 glauc glauc 229 Jul 2 21:23 README.txt