#!/bin/bash device=$(ip ad | awk '/^[0-9]+:/ { print $2 }' | sed 's/://' | gum choose) sudo iw $device scan | awk '/^BSS/ { print $2 }; /signal/ { print $2, $3, "\f" }' | sed 's/(on$//' # each result will look like: # 00:11:22:33:44:55 # -72.00 dBm # additionally, they will be separated by "\f" characters