Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

question is in title, best would be from some file in /sys instead of parsing output of iwlist ?

I need this number from output of iwconfig "Bit Rate=54 Mb/s".

Thanks

share|improve this question
    
after searching more about this, i found out that even iwconfig is calling syscall ioctl(d, SIOCGIWRATE, ...). So, parsing output of iwconfig or customizing source code of iwconfig would be optional. –  Denwerko May 2 '11 at 23:09
add comment

1 Answer

up vote 1 down vote accepted

I guess this would do it.

iwconfig wlan0 | grep Bit | awk '{print $2}' | sed 's/Rate=//'

This will return the data rate.

share|improve this answer
    
yes, im doing with this iwconfig wlan0 | grep Rate | cut -f 2 -d "=" | cut -f 1 -d " " now, but, still, it will be faster to read it from file ( if it is stored somewhere in decimal )then running iwconfig, grep,awk and sed ( or in my case 2x cut ) –  Denwerko May 2 '11 at 16:52
    
I don't think there is another way of getting the bit rate value. You can probably, without any problems run the command over 100 times per second if you want to. –  Alex May 2 '11 at 21:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.