Results 1 to 2 of 2
iwconfig displays all of my network interfaces, not just the ones with wireless extensions. I wouldn't mind that, if it was actually possible to grep out the right, wireless one.
...
- 06-28-2009 #1Just Joined!
- Join Date
- Mar 2008
- Posts
- 2
iwconfig - getting rid of the useless stuff in the output
iwconfig displays all of my network interfaces, not just the ones with wireless extensions. I wouldn't mind that, if it was actually possible to grep out the right, wireless one.
An example:
As you can see, the right name (eth1) is displayed, but along with it iwconfig echoes a bunch of useless stuff.Code:$ iwconfig | grep ESSID | cut -f 1 -d ' ' lo no wireless extensions. eth0 no wireless extensions. wmaster0 no wireless extensions. pan0 no wireless extensions. eth1
How can I get rid of it?
I've found out that saving the grepped iwconfig output to a variable does actually work, but the script still echoes the non-wireless interfaces, for instance:
How can I prevent it from doing so?Code:$ interface=$(iwconfig | grep ESSID | cut -f 1 -d ' ') lo no wireless extensions. eth0 no wireless extensions. wmaster0 no wireless extensions. pan0 no wireless extensions. $ echo $interface eth1
Thanks.
- 06-28-2009 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
What does this have to do with programming and scripts? Please move this thread to the wireless forum for appropriate help.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote