Skip to content

Instantly share code, notes, and snippets.

@mattanja mattanja/mkchmod
Created Sep 9, 2015

Embed
What would you like to do?
#!/bin/bash
#
# (c) 2007 Mattanja Kern <mattanjakern.de>
#
#USAGE="Usage: mkchmod"
USAGE="Usage: mkchmod [dirmode [filemode]]"
if [ "$1" = "" ] ; then
echo $USAGE
DIRMODE="u=rwx,g=rwxs,o-rwx"
else
DIRMODE=$1
fi
if [ "$2" = "" ] ; then
echo $USAGE
FILEMODE="u+rwX,g+rwX,o-rwx"
else
FILEMODE=$2
fi
#DIRMODE=770
#FILEMODE=$2
echo find ./ -type d -exec chmod "$DIRMODE" {} \;
find ./ -type d -exec chmod "$DIRMODE" {} \; # chmod 755 /blah
#echo find ./ -type f -perm +111 -exec chmod 111 {} \;
echo find ./ -type f -exec chmod "$FILEMODE" {} \;
find ./ -type f -exec chmod "$FILEMODE" {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.