zoukankan      html  css  js  c++  java
  • 原!linux脚本统计

    #! /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
  • 相关阅读:
    vpp编写plugin
    vrf 命令
    vxlan + 多个vrf
    dpdk helloworld
    Go函数高级
    Go_defer
    Go递归函数
    Go作用域
    Go函数
    Go字符串
  • 原文地址:https://www.cnblogs.com/wuyun-blog/p/9925283.html
Copyright © 2011-2022 走看看