您的位置:首页 > 运维架构 > Shell

解决shell脚本错误$’r’ command not found

2020-01-14 05:47 477 查看

从windows上传了一个脚本Linux上执行 出现如下错误:$'\r': command not found
这是windows与Unix文本编辑的默认格式不同造成的,需要转成unix格式。

解决方法
[root@localhost ~]# yum install -y Example.sh
[root@localhost ~]# dos2unix Example.sh
dos2unix: converting file Example.sh to Unix format ...

转载于:https://my.oschina.net/xiangyunyan/blog/3069033

  • 点赞
  • 收藏
  • 分享
  • 文章举报
chezi2598 发布了0 篇原创文章 · 获赞 0 · 访问量 666 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: