#!/bin/sh shift $((OPTIND-1)) if [ $# -gt 0 ] then _path=$* else _path=$(pwd) fi #find "$_path" -type d -exec chmod $(umask -S) {} \; #find "$_path" -type f -exec chmod $(umask -S | tr -d 'x') {} \; chmod "$(umask -S)" $(find "$_path" -type d) chmod "$(umask -S | tr -d 'x')" $(find "$_path" -type f)