#! /bin/sh 
first=$1
first2=$1
input2=$2

let second=`date -d "-1 days ago ${input2}" +%Y%m%d`

second2=$second


arr=(1 2 3 4)

length=${#arr[@]};

echo "length= ${length}"

let length=$length-1


 for i in $(seq 0 ${length}); do

sum1=0
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

 

相关文章:

  • 2021-08-31
  • 2021-05-16
  • 2021-07-22
  • 2021-09-21
  • 2021-11-17
  • 2022-01-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2021-05-21
  • 2022-12-23
  • 2021-12-15
相关资源
相似解决方案