Use gsed where available as the standard sed on OS X won't work.