fix trimd and sed->gsed in mac