use proper sed flags for osx, fix #1910