shell

来源:互联网 发布:centos怎么修改语言 编辑:程序博客网 时间:2024/06/03 21:26

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

原创粉丝点击