Ubuntu设置环境变量并立即生效
2016-01-14 15:42
281 查看
转载于:http://www.cnblogs.com/zhangpengshou/p/3537619.html
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
JAVA_HOME=/usr/hadoop/jdk1.6.0_25
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
CLASSPATH=.:$JAVA_HOME/lib
export CLASSPATH
unset i
fi
if [ "$PS1" ]; then
if [ "$BASH" ]; then
# The file bash.bashrc already sets the default PS1.
# PS1='\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
JAVA_HOME=/usr/hadoop/jdk1.6.0_25
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
CLASSPATH=.:$JAVA_HOME/lib
export CLASSPATH
unset i
fi
if [ "$PS1" ]; then
if [ "$BASH" ]; then
# The file bash.bashrc already sets the default PS1.
# PS1='\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
相关文章推荐
- keepalived 配置详解
- Yii2 framework学习笔记(五) -- 为后台更换皮肤
- SQL游标
- HDU 4826 Labyrinth
- PHP中fopen,file_get_contents,curl函数的区别
- c# 获取iis地址
- 关于FFmpegInterop项目的编译
- js Array 删除指定元素
- JPA根据业务需求 过滤接口返回对象中的某些字段
- 成本分析的一些基础知识点
- 改变Label不同的字显示不同的颜色
- uva679 Dropping Balls
- 重启脚本
- NSData与UIImage之间的转换
- UIWebView 字体大小、字体颜色、背景色
- 台式机与笔记本电脑BIOS启动热键
- Linux命令学习手册-iconv命令
- Quartz 2D基本图形的绘制
- HeartBeat
- 提交表单查询