UNIX中为什么重启或者注销之后,之前插入的环境变量PATH的值恢复到启动前的状态
如题。
也就是说,之前插入的值不见了。
求解
[解决办法]
你之前是用export设的环境变量吧,这种环境变量在再一次登录的时候就会失效的。更改profile文件才能使环境变量持续有效
[解决办法]
- C/C++ code
# /etc/profile for SuSE Linux## PLEASE DO NOT CHANGE /etc/profile. There are chances that your changes# will be lost during system upgrades. Instead use /etc/profile.local for# your local settings, favourite global aliases, VISUAL and EDITOR# variables, etc ...
[解决办法]
不要用export设置环境变量,只对当此有效,在/etc/profile文件中配置你的环境变量。这样才能每次都生效。
# /etc/profile for SuSE Linux
#
# PLEASE DO NOT CHANGE /etc/profile. There are chances that your changes
# will be lost during system upgrades. Instead use /etc/profile.local for
# your local settings, favourite global aliases, VISUAL and EDITOR
# variables, etc ...
[解决办法]
[解决办法]
没有加到.profile 里就可以了,要生效source .profile
[解决办法]
change /etc/profile or /etc/profile.local ?