@ -7,9 +7,11 @@ rmdir_empty() {
set -- .
fi
find "$@" -depth \
# do the first level directories first
-path "." -prune -or \
for maxdepth_opt in "-maxdepth 1" ""; do
-type d -empty -exec rmdir -v {} \;
find "$@" -depth -mindepth 1 $maxdepth_opt \
done
}
rmdir_empty "$@"