首页 > Windows开发 > 详细

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

时间:2015-03-04 09:50:53      阅读:952      评论:0      收藏:0      [点我收藏+]

在cygwin 下运行shell脚本,出现“$‘\r‘: command not found”,这是win dos与Unix文本编辑方式不同造成的。可以使用cygwin工具dos2unix将script改为unix格式。

$ dos2unix test.sh
dos2unix: converting file test.sh to UNIX format ...
$ sh test.sh

如此便可解决。

参见:http://lxs647.iteye.com/blog/2084375

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

原文:http://blog.csdn.net/wanwanwan123/article/details/44055409

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!