#!/bin/sh init="$(($(cat /sys/class/net/[ew]*/statistics/rx_bytes | paste -sd '*')))" printf "Recording bandwidth. Press enter to stop." read -r ending="$(($(cat /sys/class/net/[ew]*/statistics/rx_bytes | paste -sd '+')))" printf "%4sB of bandwidth used. \\n" "$(numfmt --to=iec $((ending-init)))"