现象:Linux执行脚本时,Windows回车符\r无法识别
[root@localhost 08:54:16 /home/test]# bash test.sh
test.sh:行2: $'\r': 未找到命令
hello world
解决办法:
vim test.sh # 打开此文件
:set ff=unix # (或者:set fileformat=unix)
现象:Linux执行脚本时,Windows回车符\r无法识别
[root@localhost 08:54:16 /home/test]# bash test.sh
test.sh:行2: $'\r': 未找到命令
hello world
解决办法:
vim test.sh # 打开此文件
:set ff=unix # (或者:set fileformat=unix)
1344
8026

被折叠的 条评论
为什么被折叠?