No need for quoting $_nwid within [[ ... ]] since field splitting is not
applied.
Index: install.sub
===================================================================
RCS file: /cvs/src/distrib/miniroot/install.sub,v
retrieving revision 1.1014
diff -u -p -r1.1014 install.sub
--- install.sub 3 Jun 2017 22:27:41 -0000 1.1014
+++ install.sub 15 Jun 2017 14:48:56 -0000
@@ -1060,10 +1060,9 @@ v6_config() {
# Perform an 802.11 network scan on interface $1.
# The result is cached in $WLANLIST.
ieee80211_scan() {
- # N.B. Skipping quoted nwid's for now.
[[ -f $WLANLIST ]] ||
ifconfig $1 scan |
- sed -n 's/^ nwid \([^"]\)/\1/p' >$WLANLIST
+ sed -n 's/^[[:space:]]*nwid //p' >$WLANLIST
cat $WLANLIST
}
@@ -1082,11 +1081,12 @@ ieee80211_config() {
ask_until "Access point? (ESSID, 'any', list# or '?')" "any"
case "$resp" in
+([0-9]))
- _nwid=$(ieee80211_scan $_if | sed -n "${resp}s/ .*//p")
+ _nwid=$(ieee80211_scan $_if | sed -n ${resp}'{s/ chan
.*//p;q;}')
[[ -z $_nwid ]] && echo "There is no line $resp."
+ [[ $_nwid = \"*\" ]] && _nwid=${_nwid#\"}
_nwid=${_nwid%\"}
;;
\?) ieee80211_scan $_if |
- sed -n 's/^\([^ ]*\) chan .* bssid \([^ ]*\)
.*$/ \1 (\2)/p' |
+ sed -n 's/^\(.*\) chan .* bssid \([^ ]*\)
.*$/\1 (\2)/p' |
cat -n | more -c
;;
*) _nwid=$resp