Re: root .bash_profile?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



$ man bash (INVOCATION)

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, and reads and executes commands from the first  one  that  exists  and  is
       readable.  The --noprofile option may be used when the shell is started to inhibit this behavior.

But the reference to .bash_profile has some unclear restrictions or boundaries:

~/.bash_profile
              The personal initialization file, executed for login shells

First, the ~ which might not apply to root.  Second, it’s a “personal” init file, which also might not pertain to root.  Going from user to root (su) might not initiate a login shell.  I’m not clear on this. 

But, .bash_profile is not loading.

I have my aliases in another file called /root/.bash_aliases, which is a duplicate of my /home/myuser/.bash_aliases which is NOW sourced in my /root/.bashrc so it now works.

So ya, got it to work, but knowing the cascade of inclusions is important.  root is as important to me as my normal user.  



> On May 13, 2019, at 1:17 PM, Christian, Mark <mark.christian@xxxxxxxxx> wrote:
> 
> $ man bash, search on INVOCATION



Cheers, Bee




_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]


  Powered by Linux