I am on Mac OS 10.7.x and needing to interrogate network services to report on which interfaces are defined against a service and which dns servers are set against each.
servicesAre=`networksetup -listallnetworkservices | tail -n +2 | sed 's/.*/"&"/'` ;
for interface in $servicesAre ; do
printf " \nFor $interface we have:\n \n" ;
networksetup -getdnsservers $interface ;
done
My problem is the spaces in the initial variable list of interfaces:
"USB Ethernet"
"Display Ethernet"
"Wi-Fi"
"Bluetooth PAN"
How do I pass those through?