function processFile {
if [ -d $1 ]; then
for currentFile in $1/*
do
if [ -d "$currentFile" ]; then
contain=$(echo "$currentFile" | grep '.svn')
if [ -n "$contain" ]; then
echo "rm -rf $currentFile"
else
processFile "$currentFile"
fi
fi
done
fi
}
processFile $1
來源:http://hi.baidu.com/vpsstlugkqbdpwd/item/ea33bdcb4e7fc02eee4665d4