The best way I have found to have the same script work on both Linux and Mac is to:
sed -i.bak -e 's/foo/bar/' -- "${TARGET}" &&
rm -- "${TARGET}.bak"
The best way I have found to have the same script work on both Linux and Mac is to:
sed -i.bak -e 's/foo/bar/' -- "${TARGET}" &&
rm -- "${TARGET}.bak"