Report comment

Hi Patrick. The first " is part of a statement. It is looking for the entry ssid=" in the wpa_supplicant file. The other " in the first sed removes " from the end of the ssid. The last sed inserts a delimeter of ,. This then becomes one long string of all ssids. which is then split into mutiple ssids to check with the line ssids=($wpassid) so in your case it will pickup ssid="RPi" but not ssid=1

if you paste it into terminal as
sudo awk '/ssid="/{ print $0 }' /etc/wpa_supplicant/wpa_supplicant.conf
then
sudo awk '/ssid="/{ print $0 }' /etc/wpa_supplicant/wpa_supplicant.conf | awk -F'ssid=' '{ print $2 }' ORS=',' | sed 's/\"/''/g'
then
sudo awk '/ssid="/{ print $0 }' /etc/wpa_supplicant/wpa_supplicant.conf | awk -F'ssid=' '{ print $2 }' ORS=',' | sed 's/\"/''/g' | sed 's/,$//'

you should see the breakdown of what it returns.