Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which files does bash read?

Status
Not open for further replies.

Kegnut

Technical User
Apr 18, 2001
106
0
0
US
Hello. In my home directory, I have a .bash_profile, and a .bashrc. The .bashrc doesn't contain much, but the bash_profile contains all my paths and other stuff in the format that you would see in a regular .profile. How is it that when I log in, it seems as though it reads the custom prompt I have, but the paths don't work until I do a . ./.bash_profile?

Thanks in advance,
J
 
If you start an interactive shell that is not a login shell then the .bashrc file would be read and not the .bash_profile. Otherwise, it would be the other way around, and after reading .profile, it looks for .bash_profile, .bash_login, and .profile taking the first it sees.

If you specify the --noprofile option then your .bash_profile or .bashrc wont be read either way. Try putting the contents of your .bash_profile in your .bashrc and see if that works. If it does then your .bashrc file is the one that is being read.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top