Skip to content

Commit

Permalink
Update network to support SSIDs with spaces (samtap#95)
Browse files Browse the repository at this point in the history
The results from running iwlist through awk are tab delimited. By echoing with out quotes the tabs become spaces but then the cut messes up if there is spaces. By using quotes around $x the tabs are kept and cut uses tab as the default delimiter so no need to specify.
  • Loading branch information
timwharton authored and samtap committed Apr 12, 2017
1 parent b4813d7 commit f3c3fcd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bootstrap/www/network
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ echo "<option value='' disabled selected style='display:none;'>Label</option>"

hidden=""
while read x; do
SSID=$(echo $x | cut -d' ' -f1)
ADDR=$(echo $x | cut -d' ' -f2)
ENC=$(echo $x | cut -d' ' -f3)
QUAL=$(echo $x | cut -d' ' -f4)
SSID=$(echo "$x" | cut -f1)
ADDR=$(echo "$x" | cut -f2)
ENC=$(echo "$x" | cut -f3)
QUAL=$(echo "$x" | cut -f4)
echo "<option id=\"${SSID}_OPT\">$SSID</option>"
hidden="$hidden
<input type='hidden' id=\"${SSID}_QUAL\" value=\"$QUAL\"/>
Expand Down

0 comments on commit f3c3fcd

Please sign in to comment.