BSD and GNU sed have some small differences in what arguments they accept. I just learned that I have to use different command lines when using
sed -i '' # BSD sed -i # GNU
I solved this with an IMO ugly hack involving storing the correct parameter in an environment variable.
Is there a nicer way to do that?