So, Jason Snell got me hooked on BitBar (BitBar (by Mat Ryer - @matryer) lets you put the output from any script/program in your Mac OS X Menu Bar.) and I've been working on a plugin ever since. Here's a quick way to get your current Wi-Fi SSID.

function display-ssid {
    echo "---"
ssid=$(/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I  | awk -F' SSID: '  '/ SSID: / {print $2}') 
    echo "Wi-Fi: $ssid | terminal=false bash='$0' param1=copy param2=$ssid"

}

Get wireless SSID through shell script on Mac OS X

Is there any way to get the SSID of the current wireless network through a shell script on Mac OS X?

Mark SzymanskiStack Overflow

SSID with shell script