Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Fedora This forum is for the discussion of the Fedora Project.


  Search this Thread
Old 06-27-2006, 06:24 PM   #1
Registered: Jun 2003
Distribution: Fedora 3
Posts: 82

Rep: Reputation: 15
.bashrc and .bash_profile not executed

When opening a terminal in gnome in Fedora Core 5, the .bashrc and .bash_profile in my home directory are not executed. Has anyone seen this problem and does anyone know a solution.

This is a fresh FC5 installation with all updates installed.

Old 06-27-2006, 06:41 PM   #2
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 272Reputation: 272Reputation: 272
Did you just make changes? If so, I believe you need to log out and log back in again or type source .bashrc && source .bash_profile to make them active. Other than the first time after changes, it should be right every time you login.
Old 06-27-2006, 06:46 PM   #3
Registered: Jun 2003
Distribution: Fedora 3
Posts: 82

Original Poster
Rep: Reputation: 15
Yes I have sourced this and logged in and out etc. This I think is a bug. I am in contact with one other person with this same problem on FC5.
Old 06-27-2006, 07:08 PM   #4
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,138

Rep: Reputation: 168Reputation: 168
Some things to check when you have time...

Does the terminal you're starting bash in use the --noprofile switch? This will cause the /etc/profile ~/.bash_profile, ~/.bash_login, and ~/.profile files to be ignored.

It may be that bash isn't being invoked as a login shell. When bash is invoked as a login shell, it reads the /etc/profile file if it exists. It then looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. From memory the login shell also looks for ~/.bashrc. Interactive shells that are not login shells look for ~/.bashrc but do not look for the other files.

Lastly, is your shell value in /etc/passwd set to /bin/bash rather than /bin/sh? If it is set to /bin/sh, it first attempts to read and execute commands from /etc/profile and ~/.profile, in that order. It doesn't check for the bash versions of the files.

Most of that was copy/pasted from man bash - hope it's useful...
Old 06-27-2006, 07:44 PM   #5
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,398
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Are you sure you are actually using bash?


echo $SHELL
This is almost exactly like another thread here today.

Look in /etc/passwd for your user entry. See what shell is specified. Change it to /bin/bash if that is what you want.

--- rod.
Old 06-27-2006, 08:24 PM   #6
Registered: Jun 2003
Distribution: Fedora 3
Posts: 82

Original Poster
Rep: Reputation: 15
OK Great! Found the problem. Using gnome-terminal and it is using bash. The current profile was not set as a login shell. In the gnome-terminal menu EDIT - Current Profile - Title and Command, click the box next to under "Run command as a login shell".

Npw it worls fine. Thamks very much folks.

Best Regards.


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_profile not being executed at login Radicalm16 Slackware 9 07-28-2009 09:39 PM
bashrc and .bash_profile happy78 Programming 5 10-19-2005 04:26 PM
.bashrc or .bash_profile? statmobile Linux - Newbie 1 02-04-2004 09:08 PM
.bashrc not being executed, why? realos Linux - Newbie 1 12-20-2003 07:46 PM
.bashrc vs .bash_profile xor3 Linux - Newbie 1 08-16-2003 12:52 PM > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 03:35 PM.

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