sed works differently on OS X than on Linux