convert both $rx and $tx in one call to numfmt (#1082)

see numfmt(1) for details
This commit is contained in:
Nacho-Dz 2022-03-02 13:41:22 -03:00 committed by GitHub
parent e8c7d19a2c
commit d9fb1ad732
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,4 +26,4 @@ update() {
rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes) rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes)
tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes) tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes)
printf "🔻%4sB 🔺%4sB\\n" $(numfmt --to=iec $rx) $(numfmt --to=iec $tx) printf "🔻%4sB 🔺%4sB\\n" $(numfmt --to=iec $rx $tx)