码迷,mamicode.com
首页 > 系统相关 > 详细

shell脚本运行报错$'\r': command not found

时间:2020-03-31 14:10:39      阅读:101      评论:0      收藏:0      [点我收藏+]

标签:inux   comm   set   原因   linu   命令   替换   执行   not   

执行个别shell测试脚本运行报错$‘\r‘: command not found

考虑到可能是windows与Linux的换行符不同的原因(windows是\r\n,Linux是\n)造成的,但是又不想一个个替换。

可以使用如下命令来解决:

# vi 脚本名

命令行模式下输入:

:set ff=unix

:wq 退出即可

shell脚本运行报错$'\r': command not found

标签:inux   comm   set   原因   linu   命令   替换   执行   not   

原文地址:https://www.cnblogs.com/abclife/p/12604441.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!