3 ms·
It is. Personally, I find the format far too verbose for casual use and have to process the output to make it concise enough: iwlist wlan0 scan | awk -F: '
by kevinoid 7y ago
It is. Personally, I find the format far too verbose for casual use and have to process the output to make it concise enough:
iwlist wlan0 scan | awk -F: '
BEGIN {
printf "%-40s | %3s | %5s | %4s\n", "SSID", "Enc", "Qual", "Chan"
}
function print_network() {
printf "%-40s | %3s | %5s | %4s\n", essid, key, quality, channel
}
/^[[:space:]]*Cell [0-9]+/ { if (key) { print_network() } }
/^[[:space:]]*Channel:/ { channel=$2 }
/^[[:space:]]*Encryption key:/ { key=$2 }
/^[[:space:]]*ESSID:/ { essid=$2 }
/^[[:space:]]*Quality=/ {
match($0, /[0-9]+\/[0-9]+/)
quality=substr($0, RSTART, RLENGTH)
}
END { print_network() }'