for example RX bytes, you could:
rxBytes=$(yourcmd|grep -Po '(?<=RX bytes:)\d+')
replace RX with TX, you will get another variable
EDIT
you can also go with awk:
rxBytes=$(awk -F'RX bytes:' 'NF>1{sub(/ .*$/,"",$2);print $2}')
chg RX β TX to get another.
Kent May 29 '13 at 1:40 pm 2013-05-29 13:40
source share