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
There is no way to have it working.
One way is to use a temporary file like:
TMP_FILE=`mktemp /tmp/config.XXXXXXXXXX` sed -e "s/abc/def/" some/file > $TMP_FILE mv $TMP_FILE some/file
This works on both