On Mon, Jul 22, 2013 at 3:17 PM, Markus Teich
<markus.te...@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

Reply via email to