红联Linux门户
Linux帮助

关于/etc/profile

发布时间:2012-11-24 15:15:42来源:红联作者:
ubuntu中的/etc/profile的开头部分如下:
if [ "$PS1" ]; then
if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
# The file bash.bashrc already sets the default PS1.
# PS1='\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
。。。。。。。。
在这里我有些疑惑,在读/etc/profile之前机器不会读任何文件,所以就不会有$PS1那么上面的判断句就没用了这是怎么回事????
????
求大神解决啊~!!!!!
文章评论

共有 5 条评论

  1. GJ1203 于 2013-02-23 20:55:34发表:

    profile 文件中的变量是每个用户都要使用的全局变量,在执行它之前机器不应该不读任何文件吧

  2. huafeng00001 于 2013-01-29 18:18:38发表:

    路过

  3. soap007 于 2013-01-29 12:09:09发表:

    看不懂

  4. haiyanmao_linux 于 2013-01-18 14:03:23发表:

    菜???

  5. Sourcecode 于 2012-11-24 21:34:39发表:

    路过