#!/usr/bin/env bash chgrp -R www-data static_gen/ fix_dirs() { local IFS=$'\n' for line in `find static_gen/ -type d`; do chmod g+s ${line} done } fix_dirs