0

Why is bash profile not loaded immediately on login? I'm on Centos 7.

$ ssh myuser@myserver
Last login: Tue Apr 19 08:29:23 2016
-bash-4.2#             <-- why does it say `-bash-4.2#` instead of [user@server ~]?
-bash-4.2# bash        <-- if I execute `bash` it returns to normal
[myuser@myserver ~]#   <-- success! but why doesn't it do this on login?
Ryan
  • 14,682
  • 32
  • 106
  • 179
  • 1
    Do you have different PS1's in `.bashrc` and `.profile` files ? – 123 Apr 19 '16 at 13:49
  • is it running this as a login shell as well? if it is not that may be causing this issue. Also is this on a personal system you set up or did someone else set up this system? – jgr208 Apr 19 '16 at 13:51
  • This is almost certainly login versus non-login shell differences and the files they load (`.bashrc` vs. `.profile`/`.bash_profile`). See [this answer](http://stackoverflow.com/a/415444/258523) for more info. – Etan Reisner Apr 19 '16 at 13:54
  • Thanks. I copied my `.bashrc` and `.bash_profile` from another server and it returned to normal behavior. – Ryan Apr 19 '16 at 14:16
  • You were probably sourcing your `.bashrc` file from your `.bash_profile` on the other server. – chepner Apr 19 '16 at 14:48

0 Answers0