Created
July 19, 2017 10:12
-
-
Save ChatchaiJ/815ac1b1181e70e7d05567e976622d32 to your computer and use it in GitHub Desktop.
Scan WiFi using iwlist, get rid of those parts that we don't interested
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
IFS='' | |
sudo iwlist wlan0 scanning |\ | |
grep -E 'Quality|Cell|ESSID' |\ | |
while read line; do | |
printf "%s" $line | |
ISESSID=`echo $line | grep ESSID` | |
[ "$ISESSID" ] && printf "\n" | |
done |\ | |
sed -e 's/ \+/ /g' \ | |
-e 's/\w\+=//g' \ | |
-e 's/ Cell //' \ | |
-e 's/ - Address://' \ | |
-e 's/ Signal//' \ | |
-e 's/dBm ESSID://' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment