LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   gnome: Fedora/CentOS source .bash_profile but Ubuntu/Debian source .bashrc (https://www.linuxquestions.org/questions/linux-software-2/gnome-fedora-centos-source-bash_profile-but-ubuntu-debian-source-bashrc-782724/)

centguy 01-17-2010 02:01 AM

gnome: Fedora/CentOS source .bash_profile but Ubuntu/Debian source .bashrc
 
I understand since "Run command as a login shell" is usually
UNTICKED under Gnome Terminal -> Menu Bar -> Edit -> Profiles -> Edit -> "Title and Command" whenever I open a terminal, I just don't understand
why Fedora/CentOS source the .bash_profile (which in turns source .bashrc
conveniently with

Quote:

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
)

What makes Fedora/CentOS decides to source .bash_profile (i.e., it knows
that it is login screen) ??

evo2 01-17-2010 03:14 AM

Have you tried reading and comparing the differences between the Debian and Redhat bash man pages?

Evo2.

centguy 01-17-2010 05:19 AM

Huh? I don't believe they are different since there is only one bash man pages. I think different distros tweak the customization differently.

centguy 01-17-2010 09:50 AM

I have this theory:
Fedora and Ubuntu cannot agree on the login shell definition.
When a user logins to the gnome session, Fedora considers that as a login shell and it sources the .bash_profile once (and .bashrc too since .bash_profile has a line to source .bashrc). However, Ubuntu/Debian
does not consider that as a login shell since the default setting when invoking a gnome terminal is not to run it as a login shell according
to the unticked status of "Run command as a login shell", so it ignores
.bash_profile but sources .bashrc instead. Strictly speaking, when a user login, one would consider that as a login shell
according to the logic of Fedora, but this `violates' the default setting
of unticked status of "Run command as a login shell".

If my theory is right, then it just shows that they are too much entropy in the linux world...

Personally, I find this PATH=$PATH:blahblah is so confusing. I would like
to put it in .bash_profile since we want to source PATH=$PATH:something once or else $PATH gets longer and longer (such as the Xcrysden configure sticks add the software to .bashrc and this is rather unwieldy, the
best place to put PATH=$PATH should be in .bash_profile.

evo2 01-17-2010 05:21 PM

Quote:

Originally Posted by centguy (Post 3829529)
Huh? I don't believe they are different since there is only one bash man pages.

So you generally just "believe" things and don't actually investigate?

The bash man page in Debian is quite explicit about the shell invocation.
Quote:

I think different distros tweak the customization differently.
Which in a good distro will be documented.

Evo2.

centguy 01-17-2010 07:50 PM

believe or not, "man bash" does not belong to any distro. Anyway, you have to base on common sense to decide certain things.

evo2 01-17-2010 08:35 PM

Quote:

Originally Posted by centguy (Post 3830292)
believe or not, "man bash" does not belong to any distro. Anyway, you have to base on common sense to decide certain things.

Believe it or not, distros do sometime patch packages and documentation. But if you can't be bothered trying to read documentation I really can't be bothered with you.

*plonk*

Evo2.


All times are GMT -5. The time now is 02:22 PM.