I have multiple wifi network ssid\'s saved in my etc/wpa_supplicant/wpa_supplicant.conf like shown below, can we delete a specific network from this wpa_supplicant.conf
You can write it you're self. Some very ugly Quick-n-Dirty Code would be for example:
file="/etc/wpa_supplicant/wpa_supplicant.conf"
foo="$(cat "$file" | awk '/myssid3/ { flag=1 }; flag==0 { print $0 }; /network={/ { flag=0 }' )"
if echo -e "$foo" | tail -1 | grep -q 'network={'; then
foo=$(echo -e "$foo" | head -n -1)
fi
echo -e "$foo" > "$file"