I am using sed in a script to do a replace and I want to have the replaced file overwrite the file. Normally I think that you would use this:
% sed -i \'s/c
You can use sponge from the moreutils.
sponge
sed "s/cat/dog/" manipulate | sponge manipulate