Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I brought up a new linux OS while retaining the home partition from the old one. When I mounted this home partition and created the same user accounts, the users could not access their old home directories because their user numbers had changed. I probably should have just editted the /etc/groups and /etc/passwd entries. But I tried something else instead: I used chown -R on each of the home directories to the user. That fixed the access problem.
But a new problem has emerged. When a normal user logs on, his .bashrc file is not parsed. Does anyone have any idea what I've hosed up here?
code:-------------------------------------------------------------------------
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
--------------------------------------------------------------------------------
That should be at the end of your .bash_profile
.bash_profile in your home directory is what sources the .bashrc
Are the permissions on your .bash_profile and .bashrc correct?
abyss - I know this is an old thread, but your response helped me and I've been working on the bashrc file not loading for a couple days.
I am a bit curious though, once I added the .bash_profile with the lines you mentioned, my user bashrc was loaded just fine. However before I did that (and still), if I go su it loads up the .bashrc file and there is no .bash_profile for the root account.
The .bashrc file is only sourced on non-login shells (like when you do su -- I believe "su -" opens a login shell). The .bash_profule script is sourced on login shells, so many people (including me) just have .bash_profile source .bashrc so they get the same environment regardless of whether the shell is a login or non-login shell.
That is what I believe I did, finally. At least with my user account. I created a .bash_profile under the ~/ directory and added the following lines to it:
Code:
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
However, now when I boot up and try to log on under my normal account, I get the following error message:
Code:
Cannot execute bash: No such file or directory.
This forces me to login with the root account.
I'm not sure how this happened. It may have been when I edited the permissions for my user .bash_profile or .bashrc, but I can't be sure.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.