DATE=$(date +%s)
count=$(grep -c "" $1)
time=0
sum=0
while true
do
DATE_New=$(date +%s)
if (( $(date +%s) == DATE+1))
then
((time++))
DATE=$(date +%s)
count_new=$(grep -c "" $1)
add=$((count_new - count))
if [ ! -n "$add" ]
then
add=0
fi
((sum = sum + add))
echo add line number is:$add average:$((sum / time))
count=$count_new
fi
done
count=$(grep -c "" $1)
time=0
sum=0
while true
do
DATE_New=$(date +%s)
if (( $(date +%s) == DATE+1))
then
((time++))
DATE=$(date +%s)
count_new=$(grep -c "" $1)
add=$((count_new - count))
if [ ! -n "$add" ]
then
add=0
fi
((sum = sum + add))
echo add line number is:$add average:$((sum / time))
count=$count_new
fi
done