LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-17-2010, 03:01 AM   #1
centguy
Member
 
Registered: Feb 2008
Posts: 398
Blog Entries: 1

Rep: Reputation: 35
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) ??
 
Old 01-17-2010, 04:14 AM   #2
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,520

Rep: Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216
Have you tried reading and comparing the differences between the Debian and Redhat bash man pages?

Evo2.
 
Old 01-17-2010, 06:19 AM   #3
centguy
Member
 
Registered: Feb 2008
Posts: 398
Blog Entries: 1

Original Poster
Rep: Reputation: 35
Huh? I don't believe they are different since there is only one bash man pages. I think different distros tweak the customization differently.
 
Old 01-17-2010, 10:50 AM   #4
centguy
Member
 
Registered: Feb 2008
Posts: 398
Blog Entries: 1

Original Poster
Rep: Reputation: 35
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.
 
Old 01-17-2010, 06:21 PM   #5
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,520

Rep: Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216
Quote:
Originally Posted by centguy View Post
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.
 
Old 01-17-2010, 08:50 PM   #6
centguy
Member
 
Registered: Feb 2008
Posts: 398
Blog Entries: 1

Original Poster
Rep: Reputation: 35
believe or not, "man bash" does not belong to any distro. Anyway, you have to base on common sense to decide certain things.
 
Old 01-17-2010, 09:35 PM   #7
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,520

Rep: Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216Reputation: 1216
Quote:
Originally Posted by centguy View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash's source command doesn't work with .bashrc crs_zxf Linux - Newbie 18 03-07-2009 03:25 AM
is .bash_profile the same as .bashrc in ubuntu linuxFool.lrn Linux - Newbie 13 02-08-2009 07:05 AM
Why do I have type this source /etc/bashrc to get [root@fedora6-01 ~]# ? micko_escalade Linux - Newbie 5 07-13-2007 07:03 AM
LXer: Which Distro to choose? - Comparison -(Not a Debian vs Ubuntu vs Fedora vs Centos) LXer Syndicated Linux News 0 04-16-2007 05:16 AM
bashrc or bash_profile ? ARCIS_house Linux - Newbie 6 07-21-2005 03:09 PM


All times are GMT -5. The time now is 02:55 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration