(OK) digui-dir-del-M.sh——递归

来源:互联网 发布:淘宝被投诉出售假货 编辑:程序博客网 时间:2024/05/10 13:09


digui-dir-del-M.sh


#!/bin/sheachd() {        for chkfile in $1/*        do                if [[ -f "$chkfile" ]]                then                    result=`file $chkfile |awk '{print $2}'`                    if [ "$result" == "ASCII" ]                    then                        sed 's/\r//g' $chkfile >temp.c                        mv temp.c $chkfile                        #echo $chkfile #>> result.txt                    fi                fi                if [[ -d $chkfile ]]                then                        eachd $chkfile                fi        done}#eachd "."if test -d $1then    eachd $1elif test -f $1then    echo "you input a file but not a directory,pls reinput and try again"    exit 1else    echo "the Directory isn't exist which you input,pls input a new one!!"    exit 1fi


0 0
原创粉丝点击