Mine
public text v1 · immutablegetBytes() { cat /proc/net/dev | grep $1 | egrep -o "[0-9]{2,}" | head -n1 ; }
getTp() { B=$(getBytes $1) ; sleep 1 ; A=$(getBytes $1) ; echo $(( $A - $B )) bytes/s ; }
getTp eth0
getBytes() { cat /proc/net/dev | grep $1 | egrep -o "[0-9]{2,}" | head -n1 ; }
getTp() { B=$(getBytes $1) ; sleep 1 ; A=$(getBytes $1) ; echo $(( $A - $B )) bytes/s ; }
getTp eth0