if [ -z "$1" ] then echo "Usage: $0 " exit 1 fi if ! /sbin/ifconfig $1 >/dev/null 2>&1 then echo "interface inexistante" exit 2 fi while /bin/true; do eval `/sbin/ifconfig $1 | grep 'RX bytes' | sed 's/^.*bytes:\([^ ]*\) .*bytes:\([^ ]*\) .*$/newrx=\1; newtx=\2/'` if [ -n "$oldrx" ] then echo -ne 'Réception (ko/s): '$((($newrx-$oldrx)/1024))' Emission (ko/s): '$((($newtx-$oldtx)/1024))' \r' fi oldrx=$newrx; oldtx=$newtx; sleep 1; done