mapfile -t ssids < <(
airport -s |
sed -E '
1d
/NONE$/!d
s/^[[:blank:]]*(.+) [[:xdigit:]:]{17} (...).*/ /
' |
sort -k1,1nr |
cut -d " " -f2-
)
printf "%s\n" "${ssids[@]}"
HP-Print-93-LaserJet 1102
TPE-Free
ajuste para o bash v3
ssids=()
while read -r line; do ssids+=("$line"); done < <(
airport -s |
sed -E '
1d
/NONE$/!d
s/^[[:blank:]]*(.+) [[:xdigit:]:]{17} (...).*/ /
' |
sort -k1,1nr |
cut -d " " -f2-
)
printf "%s\n" "${ssids[@]}"