Making sed use work for BSD as well as GNU