Add support for BSD (or non-linux) sed