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
-i option is not available in standard sed.
-i
sed
Your alternatives are your third way or perl.
perl