The ^M is a carriage return character. Linux uses the line feed character to mark the end of a line, whereas Windows uses the two-character sequence CR LF. Your file has Windows line endings, which is confusing Linux.

Remove the spurious CR characters. You can do it with the following command:

sed -i -e 's/\r$//' custom_script.sh


'Web > Server' 카테고리의 다른 글

데몬 스크립트 작성 및 등록하기  (0) 2018.02.21
웹서버 설정(apache2, php, mariadb)  (0) 2018.02.20
웹폴더 권한 설정  (0) 2018.02.20
Posted by jazzlife
,