A while back, I was searching for a solution to automatically disable Wi-Fi interfaces on Macs when an Ethernet device was active.  This was the solution I found that worked:

http://hints.macworld.com/article.php?story=20100927161027611

However, when setting this up on a new 15” Retina MacBook Pro, it failed because it was running OS X 10.9.  My MacBook Air running OS X 10.9.1 worked, however.  This was because they were doing something like this in bash:

SW_VER=`/usr/bin/sw_vers -productVersion`
if [ `echo "if(${SW_VER%.*}<=10.7)r=1;r"|/usr/bin/bc` -eq 1 ];
...
fi

This breaks because ${SW_VER%.*} expands to “10” when SW_VER=10.9, and 10 is not <= 10.7.  I fixed the script by going to my old friend, cut.  Here’s a diff which makes it work on both 10.9 and 10.9.x:

--- /Library/Scripts/toggleAirport.sh 2013-10-16 21:52:10.000000000 -0400
+++ toggleAirport.sh 2014-01-31 14:27:49.000000000 -0500
@@ -15,8 +15,9 @@
'

SW_VER=`/usr/bin/sw_vers -productVersion`
+SW_VER_MAJOR=`echo $SW_VER|cut -f1,2 -d.`

-if [ `echo "if(${SW_VER%.*}<=10.7)r=1;r"|/usr/bin/bc` -eq 1 ];
+if [ `echo "if(${SW_VER_MAJOR}<=10.7)r=1;r"|/usr/bin/bc` -eq 1 ];
then
APNAME="Wi-Fi"
else
@@ -56,7 +57,7 @@
# networksetup syntax changed in Snow Leopard
#

-if [ `echo "if(${SW_VER%.*}<=10.6)r=1;r"|/usr/bin/bc` -eq 1 ];
+if [ `echo "if(${SW_VER_MAJOR}<=10.6)r=1;r"|/usr/bin/bc` -eq 1 ];
then
AP_CMD="/usr/sbin/networksetup -setairportpower ${AIRPORT}"
AP_STATUS="/usr/sbin/networksetup -getairportpower ${AIRPORT}"

A gist with the correct script and corresponding /Library/LaunchDaemons plist can be found here.