On my OSX machine, I can't use ~ as the backup character for in-place sed. Any other character is fine. The error I get is... cryptic: rename(): Not a directory
.
Example:
$ echo foo > bar
$ sed -i ~ -e s/foo/hello/ bar
sed: rename(): Not a directory
$ ls -1
bar
$ cat bar
foo
$ sed -i _ -e s/foo/hello/ bar
$ ls -1
bar
bar_
$ cat bar
hello
$ cat bar_
foo