linux Execute shell script exception bad interpreter: No such file or directory

linux sh script exception /bin/sh^M:bad interpreter: No such file or directory

reason : This is caused by a different system encoding formats.

resolve : 1.Conversion at windows

        Use UltraEdit or EditPlus

        UltraEdit: File-->Conversions-->DOS-->UNIX

        EditPlus : Edit-->EOL Conversions-->Convert to UNIX Format

        2.Conversion with vi

        >vi filename

        :set ff or :set fileformat

        You can see the following information

        fileformat=dos or fileformat=unix


        :set ff=unix or :set fileformat=unix


    Finally, execute the file

Pingbacks are closed.