Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'improved script (using a Bash function)' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
improved script (using a Bash function)
Authored by: hayne on Feb 18, '05 01:25:33PM

#!/bin/sh

scutil_query()
{
    key=$1

    scutil<<EOT
    open
    get $key
    d.show
    close
EOT
}

SERVICE_GUID=`scutil_query State:/Network/Global/IPv4 | grep "PrimaryService" | awk '{print $3}'`

SERVICE_NAME=`scutil_query Setup:/Network/Service/$SERVICE_GUID | grep "UserDefinedName" | awk -F': ' '{print $2}'`

echo $SERVICE_NAME


[ Reply to This | # ]
improved script (using a Bash function)
Authored by: dreness on Feb 18, '05 01:37:22PM

very nice, thanks a bunch :)



[ Reply to This | # ]