+ -
当前位置:首页 → 问答吧 → find筛选问题

find筛选问题

时间:2011-03-05

来源:互联网

如何用循环让下列语句每2秒执行一次
cd /home/work/dl_stat
ls *.log|while read i;
do
temp=`echo $i|cut -c 36-37` ;
if [ $temp -lt 13 ] && [ $temp -gt 8 ] ;then
echo $i;
newname=${i:0:22}1${i:23} ;
echo $newname;
mv $i $newname;
fi;
done;


——————————————————————————————————————————————————————————
自己下了个,感觉不对,哪位帮改改!
#! /bin/bash
i=30;while ((i != 0));
do
cd /home/work/dl_stat
ls *.log|while read i;
do
temp=`echo $i|cut -c 36-37` ;
if [ $temp -lt 13 ] && [ $temp -gt 8 ] ;then
echo $i;
newname=${i:0:22}1${i:23} ;
echo $newname;
mv $i $newname;
fi;
done;
((i--));
sleep 2;
done

作者: liucheng1513   发布时间: 2011-03-05

热门下载

更多