LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   bashrc and profile (https://www.linuxquestions.org/questions/linux-from-scratch-13/bashrc-and-profile-815135/)

giraf 06-19-2010 11:26 AM

bashrc and profile
 
I'm in the end of chapter 4 (6.6) , its talking about bashrc ,profile and bash_profile , for host and for the new user (lfs).
Its not clear for me which is doing what and how its correlated with the different users?
Is there an article or short description that can clear things up ?
Thanks.

druuna 06-19-2010 12:13 PM

Hi,

As stated in chapter 1.1:
Quote:

Chapter 4 discusses the setup of an appropriate working environment.
All that is done in chapter 4 (up to and including chapter 4.3) is from the host and root perspective.

4.1 -> Set the LFS variable for the root user on the host. The export is there to make sure the sub shells also inherit this variable.

4.2 -> Make and link needed directory.

4.3 -> Create the lfs user on your host system. This is done as the root user on your host system. At the end of 4.3 you'll switch to this lfs user and build the temporary system (mainly chapter 5) needed to build the real lfs system (mainly chapter 6).

4.4 -> As user lfs (you switched from root to lfs with the last command in chapter 4.3) create the appropriate files to set a specific environment. The last command in 4.4 "activates" this (you could also have log out the lfs user and logged in again as user lfs).

4.5 -> Set, if you want/need to, the make flag. At this point you are ready to build the temporary lfs system.

Hope this clears things up a bit.

giraf 06-21-2010 11:44 AM

What I meant is specific to bashrc and profile:
what are the functionality of these files? does the system read them first during boot up ? on what do I influence if I change them? are they specific per user or per system?
I didn't see much data on them in the 6.6 so I'm looking for a short description or article that can explain.
Thanks.

druuna 06-21-2010 11:58 AM

Hi,

In short:

Those files (bashrc and profile) are used every time you log in (assuming the user gets a bash shell) and they set certain variables for users. Global settings are found in /etc/profile and /etc/bashrc, local settings are present in ~/.bashrc and ~/.bash_profile.

Have a look here, tells a bit more then the LFS book: The Bash Shell Startup Files, part of the BLFS book (don't execute these commands, finish LFS first).

Hope this clears things up a bit.

catkin 06-21-2010 01:14 PM

There's another explanation of the bash startup files here.

edenCC 06-21-2010 11:10 PM

Here's also a post which should meet your needs quite well,

http://planet.admon.org/howto/differ...n-login-shell/


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