Made compatible with BSD sed