Skip to content

Commit 2cdeb72

Browse files
committed
calculate only numbers
1 parent 2fb43d1 commit 2cdeb72

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bin/v-update-web-domain-traff

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@ bytes=0
4545

4646
# Parsing log
4747
while read line; do
48-
if [[ '-' != "$line" ]] && [[ 0 -lt "$line" ]]; then
48+
49+
if [[ "$line" =~ ^[0-9]+$ ]]; then
50+
line=${line#0}
4951
bytes=$(($bytes + $line))
5052
fi
53+
5154
done < $log_file
5255

5356
# Converting to Mb

0 commit comments

Comments
 (0)