bash几个rc文件的区别
http://stackoverflow.com/questions/415403/whats-the-difference-between-bashrc-bash-profile-and-environment上写:
/etc/profile The systemwide initialization file, executed for login shells~/.bash_profile The personal initialization file, executed for login shells~/.bashrc The individual per-interactive-shell startup file~/.bash_logout The individual login shell cleanup file, executed when a login shell exits~/.inputrc Individual readline initialization file
在我的ubuntu下,/etc/profile应该在开机启动阶段执行,~/.bashrc仅在起新的bash时执行,如果需要:ssh localhost 'echo $JAVA_HOME'中显示需要的JAVA_HOME,需要在~/.bash_profile中,因为启动了login,但是没有启bash。