Bash Invocation of non-login shells: Which configuration Files?
teancum144
Member Posts: 229 ■■■□□□□□□□
According to the LPIC-1/CompTIA Linux+ Certification All-in-One Exam Guide:
However, according to the following: https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html#Bash-Startup-FilesIf 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.
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?When an interactive shell that is not a login shell is started, Bash reads and executes commands from ~/.bashrc, if that file exists.
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.
Comments
-
darkerosxx Banned Posts: 1,343Pretty easy to confirm... create an alias in one or the other and try to use it.
-
teancum144 Member Posts: 229 ■■■□□□□□□□darkerosxx wrote: »Pretty easy to confirm... create an alias in one or the other and try to use it.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.
-
teancum144 Member Posts: 229 ■■■□□□□□□□Here's another source:An interactive nonlogin shell executes commands in the ~/. bashrc file. The default ~/. bashrc file calls /etc/bashrc.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.
-
darkerosxx Banned Posts: 1,343teancum144 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.