Skip to content

Instantly share code, notes, and snippets.

@kdwinter
Created March 26, 2009 16:45
Show Gist options
  • Save kdwinter/86196 to your computer and use it in GitHub Desktop.
Save kdwinter/86196 to your computer and use it in GitHub Desktop.
#!/bin/sh
# wifiscan
# Wireless interface
iface='wlan0'
# Extract info and format the output
(echo ESSID~~~Channel~~~Quality~~~Encryption && \
echo "---~~~---~~~---~~~---" && \
iwlist $iface scan | \
sed -n -e 's/.*ESSID:\(.*\)/\1/p' \
-e 's/.*Channel:\([^ ]*\)/~~~\1/p' \
-e 's/Encryption key:\(.*\)/~~~\1/p' \
-e 's/.*Quality=\([^ ]*\)\/100.*/~~~\1/p' | \
xargs -n4 echo) | \
\
awk -F~~~ '{print $1 "~~~" $3 "~~~" $4 "~~~" $2}' | \
column -tx -s ~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment