MacとCentOS(Ubuntuも?)でsedコマンドの-iオプションの挙動が異なります。
どう違うかなどは以下のmanコマンドで出力されるマニュアルを見てみましょう。
Macのsedコマンド
-i extension
Edit files in-place, saving backups with the specified extension. If a zero-length extension is
given, no backup will be saved. It is not recommended to give a zero-length extension when in-place
editing files, as you risk corruption or partial content in situations where disk space is exhausted,
etc.
CentOSのsedコマンド
-i[SUFFIX], --in-place[=SUFFIX]
edit files in place (makes backup if extension supplied). The default operation mode is to break symbolic and
hard links. This can be changed with --follow-symlinks and --copy.
ざっくり言うとMacの方はバックアップ用のファイルを作成することが推奨されているため、-iの後に何も記述しないとエラーになります。
よって、Macでsedコマンドを良い感じに使いたいなら、brew installしましょう。
そして、.bashrcにエイリアスを設定しましょう。
$ brew install gnu-sed
$ vim ~/.bashrc
alias sed='gsed'
$ source ~/.bashrc
これで、-iオプションの際にバックアップ用のファイルを指定しないで済みます。(=エラーがなくなる)