From 43f0f899ae4a0134930830fbccf7af614c87c92e Mon Sep 17 00:00:00 2001 From: Gregory Chamberlain Date: Sun, 31 May 2020 21:26:05 +0100 Subject: [PATCH] Fix arithmetic expansions --- .local/bin/statusbar/nettraf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/statusbar/nettraf b/.local/bin/statusbar/nettraf index 42da6d0..fa9eb30 100755 --- a/.local/bin/statusbar/nettraf +++ b/.local/bin/statusbar/nettraf @@ -14,12 +14,12 @@ update() { sum=0 for arg; do read -r i < "$arg" - sum=$(( "$sum" + "$i" )) + sum=$(( $sum + $i )) done cache=${XDG_CACHE_HOME:-$HOME/.cache}/${1##*/} [ -f "$cache" ] && read -r old < "$cache" || old=0 printf %d\\n "$sum" > "$cache" - printf %d\\n $(( ("$sum" - "$old") / 1024 )) + printf %d\\n $(( ($sum - $old) / 1024 )) } rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes)