On Mon, Jul 22, 2013 at 3:17 PM, Markus Teich
<markus.teich_AT_stusta.mhn.de> wrote:
>
> rx_now=0
> tx_now=0
> for i in /sys/class/net/*; do
> if [[ -d "$i" && ${i##*/} != "lo" ]]; then
> if [[ -f "$i/statistics/rx_bytes" ]]; then
> rx_now=($rx_now+`cat $i/statistics/rx_bytes`)
> fi
> if [[ -f "$i/statistics/tx_bytes" ]]; then
> tx_now=($tx_now+`cat $i/statistics/tx_bytes`)
> fi
> fi
> done
> let rx_rate=($rx_now-$rx_old)
> let tx_rate=($tx_now-$tx_old)
>
Might I ask what shell dialect is that written in? O_o
cheers!
mar77i
Received on Sat Jul 27 2013 - 18:27:17 CEST
This archive was generated by hypermail 2.3.0
: Sat Jul 27 2013 - 18:36:06 CEST