I’m using two short UNIX commands in my python script to get some data about nearby wireless access points.
- n°1, gets the ESSID of the access point :
"iwlist NIC scan | grep ESSID | awk '{print $1}'"
- n°2, gets the signal strength of the access point :
"iwlist NIC scan | grep level | awk '{print $3}'"
My problem is that I use these two commands one after the other which means that it doesn’t generate “symmetric” data. You might get 6 ESSIDs and 4 Signal strength data.
Because the first time, the script found 6 APs (A, B, C, D, E and F) and the next time only 4 APs (A, C, E and F).
Some my question is the following :
- Is there a way to “split” the result of the first
iwlist NIC scanand then apply two differentgrepandawksequences to the same input ?
Just so that you at least get a symmetric list of results.
Thank you in advance !
A script something like this might just do what you’re expecting.