MacOS and GNU sed differ in syntax for in-place editing of files. The most reliable way to get sed to work for both is to specify a backup extension and then delete the backup file. Something like:
sed -i'.bak' -e 's/foo/bar/' myfile && rm myfile.bak
MacOS and GNU
sed
differ in syntax for in-place editing of files. The most reliable way to get sed to work for both is to specify a backup extension and then delete the backup file. Something like:sed -i'.bak' -e 's/foo/bar/' myfile && rm myfile.bak