Making sed scripts run on both OS X and Linux

The replace in-place operator behaves inconsistently