#!/bin/sh ## This sets permissions for the departmental directories. It ## assumes that the user Bob (for instance) is a member of the ## group Bob and that the directory BobStuff is owned bob.bob ## and mode 775 (rwxrwxr-x) or equivalent. cd "/Volumes/Server HD 2/Library/WebServer/Documents/dept" if [ "$?" != 0 ]; then echo "Directory problem; bailing out" ; exit 1 fi while read Whom Directory do chown -R $Whom $Directory chgrp -R $Whom $Directory chmod 775 $Directory find ./$Directory -type f -exec chmod 664 {} \; find ./$Directory -type d -exec chmod 775 {} \; done < permissions