Zend certified PHP/Magento developer

macOs 10.15 Change network service order. networksetup -ordernetworkservices

Basically, I’m trying to create a script to change the network services order.

I’ve been checking macOS KB, and checking the man page of networksetup and apparently I’d should to be able to accomplish this task with below commands.

First I list my existing services with this command.

networksetup -listnetworkserviceorder | cut -d’)’ -f2 | sed ‘/^$/d’ | sed ‘1d’

Then I try to order my network services with networksetup -ordernetworkservices < ...>

networksetup -ordernetworkservices “VPN1” “LAN” “Wi-Fi” “Bluetooth PAN” “Thunderbolt Bridge” “LWS-VPN-PAR”

However doesn’t matter how I’m parsing the different services, I’m getting over and over again the same error.

Wrong number of network services… No changes have been made.
Note: Quotes must be used around service names which contain spaces (ie. “Built-in Ethernet”).
** Error: The parameters were not valid.

This is driving mad, so any guidance or help would be really appreciated.

Thanks in advance.

Cheers
Iñaky