Created
July 10, 2014 13:59
-
-
Save midwire/31379bee065749078667 to your computer and use it in GitHub Desktop.
Simple file unlocking utility for Mac OSX.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# Simple file unlocking utility for Mac OS X | |
# | |
ARGS=1 | |
E_BADARGS=65 | |
SETFILE=/Applications/Xcode.app/Contents/Developer/usr/bin/SetFile | |
function recursiveUnlock() { | |
pushd $1 | |
for rdir in `ls -A`; do | |
if [ -d "${rdir}" ]; then | |
recursiveUnlock "${rdir}" | |
else | |
$SETFILE -a l "${rdir}" | |
fi | |
done | |
popd | |
} | |
if [ $# -ne "$ARGS" ] | |
then | |
echo "Usage: `basename $0` starting-directory" | |
exit $E_BADARGS | |
fi | |
recursiveUnlock $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment