#!/bin/bash list=`awk ‘/19:/,/21:/{print $10}‘ /data/opt/nginx/logs/access.log | tr -d "[[:punct:]]|[[:alpha:]]"` sum=0 for i in $list;do sum=$[$sum+$i] done echo $sum
时间: 2024-10-20 08:10:00
#!/bin/bash list=`awk ‘/19:/,/21:/{print $10}‘ /data/opt/nginx/logs/access.log | tr -d "[[:punct:]]|[[:alpha:]]"` sum=0 for i in $list;do sum=$[$sum+$i] done echo $sum