20. Programming/Tools - Bash Shell

[bash shell] for ... in 문

x미소 2018. 11. 12. 16:24



# Array 선언 ( Array는 space로 아이템을 구분한다.)

declare -a RM_DIRS

RM_DIRS=("00_img*" "10_sys" "30_tool" "40_script" "50_download_*" ".repo" ".git" "bapapp" "btapp" "TundraWinSimul" "android_auto" "bin" "mw" "lib")


# for 문

for paramStr in ${RM_DIRS[@]}; do

    echo "Removeing directory : ${paramStr}  ......"

    find . -type d -name ${paramStr} -exec rm -rf {} \;

done