Linux 错误: $'\r': command not found

比眉伴天荒 2023-10-11 10:33 74阅读 0赞
  1. linux无法解析$'\r'。这其实是windowslinux系统的差异导致的。
  2. 因为linux上的换行符为\n,而windows上的换行符为\r\n。所以脚本到linux上就无法解析了。
  3. 通常的处理办法主要有2种:
  4. 处理办法1 set ff=unix
  5. vi hello.sh
  6. ### Esc进入命令行运行模式
  7. ### : set ff=unix
  8. 1
  9. 2
  10. 3
  11. 处理办法2 dos2unix
  12. dos2unix hello.sh
  13. ### 如果报command not found 是因为你没有安装,安装dos2unix插件即可。
  14. ---------------------
  15. 作者:在风中的意志
  16. 来源:CSDN
  17. 原文:https://blog.csdn.net/u010416101/article/details/80135293
  18. 版权声明:本文为博主原创文章,转载请附上博文链接!

转载于:https://www.cnblogs.com/Stephen-Qin/p/11299785.html

发表评论

表情:
评论列表 (有 0 条评论,74人围观)

还没有评论,来说两句吧...

相关阅读