Bash Invocation of non-login shells: Which configuration Files?

teancum144teancum144 Member Posts: 229 ■■■□□□□□□□
According to the LPIC-1/CompTIA Linux+ Certification All-in-One Exam Guide:
If you’re using a non-login shell, things are pretty straightforward. The bash shell simply runs /etc/bashrc for system-wide functions and aliases, and then it runs ∼/.bashrc from the user’s home directory for user-specific customizations.
However, according to the following: https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html#Bash-Startup-Files
When an interactive shell that is not a login shell is started, Bash reads and executes commands from ~/.bashrc, if that file exists.
The above is in conflict. Does Bash execution the /etc/bashrc file prior to the ∼/.bashrc or not? What script could I look at to verify this?
If you like my comments or questions, you can show appreciation by clicking on the reputation badge/star icon near the lower left of my post. :D

Comments

  • darkerosxxdarkerosxx Banned Posts: 1,343
    Pretty easy to confirm... create an alias in one or the other and try to use it.
  • teancum144teancum144 Member Posts: 229 ■■■□□□□□□□
    darkerosxx wrote: »
    Pretty easy to confirm... create an alias in one or the other and try to use it.
    I'm a little unclear? =) Would you mind providing a little more detail?
    If you like my comments or questions, you can show appreciation by clicking on the reputation badge/star icon near the lower left of my post. :D
  • teancum144teancum144 Member Posts: 229 ■■■□□□□□□□
    Here's another source:
    An interactive nonlogin shell executes commands in the ~/. bashrc file. The default ~/. bashrc file calls /etc/bashrc.
    Sobell, Mark G. (2012-09-14). A Practical Guide to Linux Commands, Editors, and Shell Programming (3rd Edition) (Kindle Locations 8353-8354). Pearson Education. Kindle Edition.
    If you like my comments or questions, you can show appreciation by clicking on the reputation badge/star icon near the lower left of my post. :D
  • darkerosxxdarkerosxx Banned Posts: 1,343
    teancum144 wrote: »
    I'm a little unclear? =) Would you mind providing a little more detail?

    Create an alias in one of the bashrc files and try to use it under both conditions. One will fail and you will know which one works.
Sign In or Register to comment.