Welcome to the Linux Foundation Forum!

seeking understanding

Hi,

I'm building LFS to "build" my understanding of the linux/gnu operating system.

I know there is a difference between a "login shell" and a "non" login shell. Somehow I manage to get easily confused. As I was building LFS, I 've been making a mistake that I caught this time, I had used a non login root shell as opposed to a login shell. I was wondering what effect that would have on a build of programs ? Would it in effect change the build environment? one reads the ,bash_profile and the other reads the .bashrc?

Comments

  • atreyu
    atreyu Posts: 216
    tw3ak wrote:
    I was wondering what effect that would have on a build of programs ? Would it in effect change the build environment?
    It could. It all depends on what is in the startup scripts, and what the build environment expects or inherits. E.g., you might have
    export CC=arm-linux-gcc
    
    in your ~/.bash_profile, which definitely might affect a 'make' command, depending on the Makefile...
    one reads the ,bash_profile and the other reads the .bashrc?
    More explicitly, according to 'man bash':
    When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order...When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc...

Categories

Upcoming Training