From: Bill G. <bg...@bi...> - 2007-07-23 12:37:45
|
>> #ifconfig wlan0 |grep "RX bytes"|awk '{print $2}' >> bytes:545078 >> >> >> how can I separate the values with the "bytes:"? >> I want to see if value2-value1>1000, then echo ">1000" ..... >> >> >> > pipe the results into cut > > #ifconfig wlan0 |grep "RX bytes"|awk '{print $2}' | cut -d ":" -f 2 > Or the equivalent entirely within awk: # ifconfig eth0 | awk -F: '/RX bytes/ {split($2,rxbytes," "); print rxbytes[1];}' b.g. -- Bill Gatliff bg...@bi... |