linux遞歸刪除svn

#!/bin/sh 

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

發佈了54 篇原創文章 · 獲贊 37 · 訪問量 39萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章