Tuesday, August 11, 2015

Vim - How to remove the ^M Line break?

■ When a script file can not be executed, because of ^M
$ ./startBatchSample.sh 

-bash: ./startBatchSample.sh: /bin/sh^M: bad interpreter: No such file or directory

■■ This is the solution. ■■
■ Change mode into Unix.
:set fileformat=unix


■ Change mode into Dos.(This is extra information.)
:set fileformat=dos

No comments:

Post a Comment