在你 用vi或者gedit时注意格式问题不然会犯以下错误

bash: /etc/profile: 行 39: 语法错误: 未预期的文件结尾 bash: /etc/profile: 行 31: 未预期的符号 then' 附近有语法错误 bash: /etc/profile: 行 31:if["$EUID" = "0"];then'

原因:

正确书写格式为:

if [ -d etc/profile.d ]; then

...

...

fi

所以注意标点符号和空格