Linux 错误: $'\r': command not found
是linux无法解析$'\r'。这其实是windows与linux系统的差异导致的。
因为linux上的换行符为\n,而windows上的换行符为\r\n。所以脚本到linux上就无法解析了。
通常的处理办法主要有2种:
处理办法1 set ff=unix
vi hello.sh
### Esc进入命令行运行模式
### : set ff=unix
1
2
3
处理办法2 dos2unix
dos2unix hello.sh
### 如果报command not found 是因为你没有安装,安装dos2unix插件即可。
---------------------
作者:在风中的意志
来源:CSDN
原文:https://blog.csdn.net/u010416101/article/details/80135293
版权声明:本文为博主原创文章,转载请附上博文链接!
转载于//www.cnblogs.com/Stephen-Qin/p/11299785.html
还没有评论,来说两句吧...