FWIW, that's not correct. On BSD (incl macOS), the -i option takes an argument for the file extension to use as a tmp file:
So for GNU sed:
sed -i 's/old/new/g' FILE
sed -i '' 's/old/new/g' FILE
Also, GNU sed takes an extension argument too, but it is optional:
sed -iEXT 's/old/new/g' FILE
FWIW, that's not correct. On BSD (incl macOS), the -i option takes an argument for the file extension to use as a tmp file:
So for GNU sed:
Translates to BSD sed as: It is not recommended to use an empty string as the extension, but as long as your sed command does not fail due to disk space etc, it is fine.Also, GNU sed takes an extension argument too, but it is optional: