执行shell脚本报错
bin/sh^M: bad interpreter: No such file or directory
原因:.sh脚本是在windows下用编辑器写的,和linux系统的编码格式不同。
解决办法:
1.确保用户对脚本具有读写执行权限
chmod a+x start.sh
2.查看并修改文件格式
vi start.sh
:set ff
:set ff=unix
:wq
执行shell脚本报错
bin/sh^M: bad interpreter: No such file or directory
:set ff
:set ff=unix
:wq