Is there an invocation of sed todo in-place editing without backups that works both on Linux and Mac? While the BSD sed shipped with OS X seems to
sed
The -i option is not part of POSIX Sed. A more portable method would be to use Vim in Ex mode:
-i
ex -sc '%s/alfa/bravo/|x' file
% select all lines
%
s replace
s
x save and close
x