Parametrise which version of sed to use to make this script compatible with linux and Mac