sed -i does work in bsd-type environments (in fact, freebsd and gnu added the -i argument around the same time, in early 2002), the main difference is that bsd variants follow strict getopt shortopt parsing (i.e. no optional values, and -i always takes a suffix, with -i '' being equivalent to just -i in gnu) while gnu sed -i is quirky and reliant on its own getopt extensions (in gnu, sed -i '' does not work, but sed -i'' does)<p>the common portable invocation is something like `sed -ibak`, which works in both variants, and then remove the backup file; as far as i know, there is no way to portably invoke sed that does <i>not</i> backup