change sed parameters so it works with both BSD and GNU sed