Facing a problem because of the "Spaces" in networks names
Hello everyone!
i have a thin client device with armbian cli OS, and I've created a script that would "using nmcli" list a numerated list of the names of the available networks and select one of them by it's number like: Available networks: 1. my_home 2. some_network 3. my 4. wifi "the problem is in listing network 3,4 in different lines" when clicking on 1, it would ask for the password of "my_home",then type it's password and you are connected.. the problem is if i want to connect to "my wifi" network it is seeing it as if it's a different netowkrs because of the space between my and wifi in the name here is the functions i'm using: Code:
connect_network() { Could someone please provide me with a solution or workaround for connecting to the Wi-Fi networks with spaces in their names within the script? Any assistance would be greatly appreciated. Thank you! |
I don't have network manager.
Yours Code:
networks=(my_home some_network my wifi) Code:
networks=('my_home' 'some_network' 'my wifi') |
As posted...
Quote:
And therefore Quote:
Quote:
Code:
res=$(nmcli -f SSID device wifi list | awk 'NR>1{print $0}') If I "read" into your script you are using the second loop to create a menu? Check out bash's select, it might make your script simpler. |
nm :eek:
|
All times are GMT -5. The time now is 10:15 PM. |