shell变量分为环境变量(全局变量),和局部变量;
环境变量要想永久生效,则可以放在/etc/profile,或 .bash_profile
例如:
①当前用户下生效:
vi .bash_profile
用 . .bash_profile
检验:echo $OLDBOY
②:全局下面生效
vi /etc/profile
export OLDBOY=‘oldboy‘shell变量
原文:http://blog.csdn.net/u014236541/article/details/43815903