How to remove ^M charater

Open the file in VI editor

$ vi my_script.sh

In VI editor, set the file format to unix

:set ff=unix
:wq
Advertisements