#!/bin/sh documentation="\ Recursively fix permissions on the given directories to allow GID=0 read/write regular files and read/write/execute directories. To run this command, you have to be in the group root=0!" uid=26 write=w usage () { cat >&2 <&2 "fixing permissions on '$dir' directory" find "$dir" -exec chown "$uid:0" {} \; find "$dir" -exec chmod "g+r$write" {} \; find "$dir" -type d -exec chmod g+x {} + done