a bit better
This commit is contained in:
parent
a5b26c90f0
commit
3294073c9f
1 changed files with 3 additions and 3 deletions
|
@ -12,6 +12,6 @@ rend="$(($(cat /sys/class/net/[ew]*/statistics/rx_bytes | paste -sd '+')))"
|
||||||
tend="$(($(cat /sys/class/net/[ew]*/statistics/tx_bytes | paste -sd '+')))"
|
tend="$(($(cat /sys/class/net/[ew]*/statistics/tx_bytes | paste -sd '+')))"
|
||||||
|
|
||||||
# Format correctly and print
|
# Format correctly and print
|
||||||
dow=$(printf "%2sB\n" "$(numfmt --to=iec $(($rend-$rstart)))" | sed 's/ //g')
|
dow=$(printf "%2sB\n" "$(numfmt --to=iec $(($rend-$rstart)))")
|
||||||
up=$(printf "%2sB\n" "$(numfmt --to=iec $(($tend-$tstart)))" | sed 's/ //g')
|
up=$(printf "%2sB\n" "$(numfmt --to=iec $(($tend-$tstart)))")
|
||||||
printf "%2s" "$dow|$up" > "$XDG_CACHE_HOME"/netstat
|
printf "$dow|$up" | sed 's/ //g' > "$XDG_CACHE_HOME"/netstat
|
||||||
|
|
Loading…
Reference in a new issue