.bashrc vs. .bash_profile

Magnus Therning magnus at therning.org
Sat Jul 16 08:15:21 UTC 2005

On Fri, Jul 15, 2005 at 04:40:06PM +1000, Russell Cook wrote:
>On Fri, 2005-07-15 at 07:22 +0200, Dennis Kaarsemaker wrote:
>> On vr, 2005-07-15 at 01:05 -0400, Matthew S-H wrote:
>>> What is the difference?  Under what situations does it read one over
>>> the other?
>> .bash_profile is sourced for login shells (where you need to enter a
>> password) and .bashrc for the rest. So .bash_profile should contain
>> thing only to be done once per session and .bashrc should contain
>> things to be done for every terminal you open.
>that makes sense, but for noobies, how do we tell what needs to be run
>for ever terminal. For instance the path extension statement I was
>looking at. Is the path global for that login, or only that shell?

It depends :-)

If you export it from the login shell then it will be present for all
its children.

It all gets rather complicated when you add GNOME into the mix. AFAIK
there is no login shell when you log in using GDM (the shell that execs
gnome-session isn't interactive either). I just make every terminal
start a login shell (there's a setting for gnome-terminal), that way I
know what I get.


Magnus Therning                    (OpenPGP: 0xAB4DFBA4)
magnus at therning.org

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

We didn't do this with just a pencil and some paper. Lots of our notes
are in pen. We didn't need to erase much.
      -- Tim Hollebeek and John Viega, on breaking defective crypto in
         Netscape's mail password saver
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050716/0c94168a/attachment.pgp>

More information about the ubuntu-users mailing list