linux中的~/.bashrc和/etc/profile

来源:百度知道 编辑:UC知道 时间:2024/05/31 13:43:40
我以前在~/.bashrc中写了个PS1变量,有用,后来不知怎么的开机时不运行我的设置,我用命令“source ~/.bashrc”时能运行;
我在/etc/profile中设置PS1变量,也是开机不能执行,用source就可以了,而重新开机后有这样。
一开始没加,现在我加上去有试了一遍,还是没用

你的 .bash_profile 有没有这些

# source the system wide bashrc if it exists
if [ -e /etc/bash.bashrc ] ; then
source /etc/bash.bashrc
fi

# source the users bashrc if it exists
if [ -e "${HOME}/.bashrc" ] ; then
source "${HOME}/.bashrc"
fi

没有加入去就OK , 呵呵

加上了export 了吧?