http://www.runoob.com/linux/linux-comm-declare.html
执行第一个hello word实例时,报错:-bash: ./hello.sh: /bin/bash^M: bad interpreter: No such file or directory
是由于编码格式的问题。由于我现在windows将 sh文件编写好了 再上传linux。文件编码是dos 所以将文件格式改成unix即可。
# vi hello.sh
查看文档格式
:set ff?
返回
fileformat=dos
修改文档格式
:set ff=unix