Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1086605
  • 博文数量: 143
  • 博客积分: 969
  • 博客等级: 准尉
  • 技术积分: 1765
  • 用 户 组: 普通用户
  • 注册时间: 2011-07-30 12:09
文章分类

全部博文(143)

文章存档

2023年(4)

2021年(2)

2020年(4)

2019年(4)

2018年(33)

2017年(6)

2016年(13)

2014年(7)

2013年(23)

2012年(33)

2011年(14)

我的朋友

分类: LINUX

2019-06-18 21:10:02



path=$1
arrs=(20190618)
for ip in ${arrs[@]};
do
 tmp=$path$ip 
 filelist=`ls $tmp`
 for file in  $filelist
 do
  echo   $path$file
   if test -f $file
    then
        echo $file  is file
    else
        echo $file  is dir
        #$cd $file 
        parent=$tmp'/'$file
        tmpfilelist=`ls $parent`
        for tmpfile in $tmpfilelist
        do
           strfile='_imgs'
           if test -f $tmpfile
           then
             echo 'file:'$tmpfile
           else
            echo 'tmpfile:'$parent'/'$tmpfile
             if [[ $tmpfile == *$strfile* ]]
              then  
                echo 'equal files:'$tmpfile
              else
               son=$parent'/'$tmpfile
               
                if [ "${son##*.}" = "theme" ]
                then
                  echo 'delfile11:' $son
                  rm -f $son
                fi


                echo 'delfile:'$son
     
               #echo $son'/icon'
                rm  -rf $son'/icon'
          
                 
              fi
           fi   
        done
        #echo 'del:' $1$file'/temp'
        #rm -rf $1$file'/temp'
    fi
  done
done 
阅读(754) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~