summaryrefslogtreecommitdiffstats
path: root/.local/bin/statusbar/nettraf
diff options
context:
space:
mode:
authorKian Kasad <kdkasad@gmail.com>2020-05-09 16:32:56 -0700
committerGitHub <noreply@github.com>2020-05-09 19:32:56 -0400
commit6577acae890e18dc99244599fc85fa31053e400e (patch)
treebf4a2bcb499931889809c6cb9bca95aa9689b866 /.local/bin/statusbar/nettraf
parent2b6b3822e32b11f3f6bf65cd64d4801bdacb0173 (diff)
downloadeibhear-6577acae890e18dc99244599fc85fa31053e400e.tar.gz
eibhear-6577acae890e18dc99244599fc85fa31053e400e.tar.zst
eibhear-6577acae890e18dc99244599fc85fa31053e400e.zip
replace `tr '\n' 'CHAR'` with `paste -sd 'CHAR'` (#625)
Diffstat (limited to '.local/bin/statusbar/nettraf')
-rwxr-xr-x.local/bin/statusbar/nettraf4
1 files changed, 2 insertions, 2 deletions
diff --git a/.local/bin/statusbar/nettraf b/.local/bin/statusbar/nettraf
index bac22d8..d96d979 100755
--- a/.local/bin/statusbar/nettraf
+++ b/.local/bin/statusbar/nettraf
@@ -13,8 +13,8 @@ esac
rxfile="${XDG_CACHE_HOME:-$HOME/.cache}/rxlog"
txfile="${XDG_CACHE_HOME:-$HOME/.cache}/txlog"
-rxcurrent="$(cat /sys/class/net/*/statistics/rx_bytes | tr '\n' '+' | sed 's/+$/\n/' | bc)"
-txcurrent="$(cat /sys/class/net/*/statistics/tx_bytes | tr '\n' '+' | sed 's/+$/\n/' | bc)"
+rxcurrent="$(cat /sys/class/net/*/statistics/rx_bytes | paste -sd '+' | bc)"
+txcurrent="$(cat /sys/class/net/*/statistics/tx_bytes | paste -sd '+' | bc)"
printf "🔻%skB 🔺%skB\\n" \
"$(printf -- "(%s-%s)/1024\\n" "$rxcurrent" "$(cat "$rxfile")" | bc)" \