#!/bin/bash lineCount=`wc -l test.old.log | awk '{print $1}'` for((i=1;i<$lineCount;i++)) do if((i%10==0)) then lastNo=$[ $i+10 ] # echo $i+'\r'+$lastNo sed -n "$i,$lastNo p" test.old.log >> newLog.log sleep 1s fi done
#!/bin/bash lineCount=`wc -l test.old.log | awk '{print $1}'` for((i=1;i<$lineCount;i++)) do if((i%10==0)) then lastNo=$[ $i+10 ] # echo $i+'\r'+$lastNo sed -n "$i,$lastNo p" test.old.log >> newLog.log sleep 1s fi done
转载于:https://www.cnblogs.com/whutqueqiaoxian/p/8728181.html