#!/bin/bash SAVEIFS=$IFS IFS=$(echo -en "\n\b") for x in $(find /home -mindepth 1 -maxdepth 1 -type d); do echo $x g="$(stat -c %G $x)" if [ "$g" = "Domain Users" ];then chown :nogroup $x chmod o-rwx $x fi done IFS=$SAVEIFS