From d8272650bd675011496b4825160510109e47bba5 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 30 May 2020 11:09:12 -0400 Subject: [PATCH] paste directly on files, excluding lo --- .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 9a81ad2..82305c3 100755 --- a/.local/bin/statusbar/nettraf +++ b/.local/bin/statusbar/nettraf @@ -13,8 +13,8 @@ esac logfile="${XDG_CACHE_HOME:-$HOME/.cache}/netlog" prevdata="$(cat "$logfile")" -rxcurrent="$(($(cat /sys/class/net/*/statistics/rx_bytes | paste -sd '+')))" -txcurrent="$(($(cat /sys/class/net/*/statistics/tx_bytes | paste -sd '+')))" +rxcurrent="$(($(paste -d '+' /sys/class/net/[ew]*/statistics/rx_bytes)))" +txcurrent="$(($(paste -d '+' /sys/class/net/[^lo]*/statistics/tx_bytes)))" printf "🔻%sKiB 🔺%sKiB\\n" \ "$(((rxcurrent-${prevdata%% *})/1024))" \