use /usr/bin/env sed instead of /bin/sed.