tags:

views:

88

answers:

4

When I login to a sun box: SunOS domain.com 5.8 Generic_117350-57 sun4u sparc SUNW,Sun-Fire-V240

I start in the sh shell: SHELL=/bin/sh

I type bash to start a bash shell, then have to type . .bash_profile to load my profile. Is there a way it can be set to automatically load the profile?

+2  A: 

Put

. ~/.bash_profile

in ~/.bashrc (watch out for infinite loops!). I don't use that myself, as I have most stuff in .bashrc to begin with (except, well, env. stuff and so on).

janneb
+1  A: 

.bash_profile is only used for login shells, for non-login shells (like yours), bash uses .bashrc.

The easiest thing is for you to add . .bash_profile to your .bashrc.

You also have to make sure that you don't print out anything in non-interactive shells, or you can break scp/sftp.

Douglas Leeder
+1  A: 

Running bash like this causes it to source /etc/bash.bashrc and then ~/.bashrc in lieu of .bash_profile (and other files). Therefore, put . ~/.bash_profile in ~/.bashrc, (or in /etc/bash.bashrc to do this for all users).

Cirno de Bergerac
A: 

The file .bash_profile is run when upon login. The file .bashrc is run when running bash from a non-login session.

Try adding this to your .bashrc:

source ~/.bash_profile
Alex Reynolds