I have a bash script that places the gsm modem connection name in a variable:
name=$(nmcli -f NAME, TYPE c | grep gsm | grep -oP '.*(?=gsm)')
echo $name
gives me "Provider connection"
.
However, when I use $name to bring the interface up I get the following:
nmcli -t con up id "$name"
results in "Error: Unknown connection: Provider connection ."
.
I've tried using ${name} as well and to try and find where the period is coming from I used "($name)" which results in "Error: Unknown connection: (Provider connection )." Also tried writing the connection name to a file an then reading that into a variable but no luck there.
Anybody know where that trailing period/dot comes from?