sublime text 3编写shell脚本执行报$'\r': command not found

在sublime text 3编写好shell脚本后执行报$'\r': command not found

但是Ctrl+F通过正则表达式搜索发现结尾只有换行符并没有回车符

但是通过notepad打开的确能看到有'\r'

由于默认设置换行符跟随系统,在Windows中换行符是'\r\n',所以在Preferences->Setting->Setting-User中更改配置为

"default_line_ending": "unix", // 默认是system
改成Unix系统的换行符就好了,在Windows使用也不影响。

猜你喜欢

转载自blog.csdn.net/fanlying/article/details/79743178