-bash: /etc/profile: line 11: syntax error near unexpected token `$'{\r'' 'bash: /etc/profile: line

-bash: /etc/profile: line 11: syntax error near unexpected token `$'{\r'' 'bash: /etc/profile: line

绿林寻猫
2021-12-08 / 0 评论 / 550 阅读 / 正在检测是否收录...

使用source命令不能生效

使用cat -v /etc/profile检查,发现里面大量的Windows下的换行符:

解决方法:

#cd /etc
#dos2unix profile

使用dos2unix profile将profile文件从Windows格式文件转换为Unix、Linux格式,然后在执行source profile使之生效

查看

#echo $PATH

 

0

评论 (0)

取消