bash csh/tcsh 环境变量的设置
May102007
作者:u2 发布:2007-05-10 09:49 分类:others bash csh/tcsh 环境变量的设置已关闭评论
用户shell配置文件
$HOME/.profile (Bourne shell, sh, bash)
$HOME/.cshrc (csh, tcsh)
$HOME/.tcshrc (tcsh)
/etc/passwd文件中列出每个用户的shell
/etc/csh.cshrc
/etc/csh.login
/etc/profile (Bourne shell, bash)
/etc/login (Bourne shell, bash)
bash / sh等
(一)
.bshrc
JAVA_HOME=/usr/java/jdk
CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar:
$JAVA_HOME/lib/dt.jar
PATH=$PATH:$JAVA_HOME/bin:/usr/local/apache/bin
export PATH CLASSPATH
PATH=/usr/local/mysql/bin:$PATH
export PATH
在sh/bash下手工执行相关文件:
. /etc/profile
(二)
csh/tcsh:
.cshrc
set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin
/usr/X11R6/bin $HOME/bin)
在csh/tcsh下手工执行相关文件:
source .cshrc
相关文件执行顺序
sh: /etc/profile -> $HOME/.profile
csh/tcsh: /etc/csh.cshrc -> /etc/csh.login -> $HOME/.cshrc -> $HOME/.login
最活跃的读者