Chinaunix首页 | 论坛 | 博客
  • 博客访问: 101468990
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-04-18 23:03:32

作者:cnhawk   
#!/usr/bin/ksh
#write by cnhawk
#for delete all the match time file
#such as ash_2005-01-15.log with for 
#date 2005-11-23

for x in 2004 2005
 do
   for y in 01 02 03 04 05 06 07 08 09 10 11 12 
     do
       for z in 01 02 03  ...  31
         do
            for files in $(ls *$x-$y-$z*)#var replace ls match files
                do
                    echo "the $files in match will be delete!"
                     rm $files
                 done
          done
     done
done
阅读(501) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~