for the longest time, I wanted to write a simple script that could quickly find the SSID of the current wireless network that I was operating on. If you're not up on the current technical lingo, a SSID is a Service Set IDentifier, and it's basically the textual name for the wireless access point. I wanted this for a variety of reasons, but mostly I wanted to write/develop a script that would watch for when the SSID changed, and when it changed to tmobile, log on to tmobile so I wouldn't have to do that myself.
However, the only place that I knew this data was avalible from the command line was in the system_profiler tool; the problem was that this tool collected massive amounts of data and could take (on my PowerBook G4) over 1.5 minutes to run -- this was simply not acceptable.
After installing Panther, I found that there were a plethora of options now available to limit the amount of data gathered by the system profiler tool. For example, running this command:
system_profiler SPAirPortDataType|grep -e "Current Wireless Network:"|awk '{print $4}'
printed out the current SSID (tmobile at the moment; I'm sitting in a Starbucks in Manhattan),
and it takes less than one second to find that information from the system. An amazing speed improvement. If the above fails to find the command, you might have to add /usr/sbin/ in front of it (though that directory should be on your path).
Mac OS X Hints
http://hints.macworld.com/article.php?story=20031013102653367