Bash.profile not loading

I'm not sure what happened, but my ~ / .profile is no longer loading.

Can someone see something wrong with the following?

export PS1="\ u@local [\w]# " export EDITOR="subl -w" export CLICOLOR=1 export LSCOLORS=GxFxCxDxBxegedabagaced alias vst="ssh -i ~/.ssh/vst root@vst " 

I know that using this PS1, as I try to do, Peter@local [~/path/to/file]# should be executed, but it is not.

Any ideas?

+7
source share
3 answers

Are there ~/.bash_profile or ~/.bash_login ? If so, it will be used instead of ~/.profile .

+17
source

In the Unix FAQ (for OS X) you can read:

Bash Launch Files

When the login shell starts, it reads the /etc/profile file, and then ~/.bash_profile or ~/.bash_login or ~/.profile ( depending on what exists - it only reads ONE of these , checking them in indicated order).

When the non-login shell starts, it reads the /etc/bashrc file and then the ~/.bashrc .

Note that when bash is called with the name sh , it tries to simulate the startup sequence of the Bourne ( sh ) shell. In particular, a non-login shell called as sh does not read point files by default. . See the bash man page for more details.

So, if you are already ~/.bash_profile , the ~/.profile file will not be automatically read by bash, so you can add the following lines to your ~/.bash_profile to download it:

 # Load user profile file if [ -f ~/.profile ]; then . ~/.profile fi 
+9
source

I need to log in for this user to get ~/.bash_profile or ~/profile to reload the changes.

 su - drew 

You must use a dash between su and username.

-2
source

All Articles