#! /bin/sh
first=$
first2=$
input2=$ let second=`date -d "-1 days ago ${input2}" +%Y%m%d` second2=$second arr=( ) length=${#arr[@]}; echo "length= ${length}" let length=$length- for i in $(seq ${length}); do sum1=
first=$first2 cmppid=${arr[$i]}
echo "cmppid =${cmppid},统计如下:" while [ "$first" != "$second" ]
do
statistics_num=`cat detail_"$first".txt |grep -E ".*${cmppid}.*" | wc -l`
echo detail_"$first".txt statistics_num="$statistics_num"
let sum1=$sum1+$statistics_num
let first=`date -d "-1 days ago ${first}" +%Y%m%d`
done echo "sum1=$sum1" done
05-11 22:17
查看更多