#!/bin/bash
读取当前桌面以.log结尾的文件
dir=/Users/ben/Desktop
for file in $dir/*.log;
do
echo $file
定义储存ping值的数组arr1()
arr1=()
for i in `cat $file | grep -i -n "round-trip average" | awk '{print $3}' `
do
echo $i
arr1+=${i}
done
#客户端数组arr2
arr2=()
for c in cat $file | grep -i "Client Netname" | awk '{print $3}'
# echo c l i e n t d o