[arch-dev-public] System-wide bashrc?

RedShift redshift at pandora.be
Tue Aug 25 05:30:45 EDT 2009


Thomas Bächler wrote:
> RedShift schrieb:
>> /usr/bin/bash2:
>> #!/bin/bash
>> bash --rcfile /etc/bashrc
>>
>> and then
>>
>> echo "/usr/bin/bash2" >> /etc/shells
>> usermod -s /usr/bin/bash2 myuser
> 
> Yes, or create /etc/bashrc, then /etc/bashrc.d/ and allow to move files 
> there just like /etc/profile.d.
> 

I was only illustrating the idea I had about how I would fix it, shouldn't be much hassle to add the features you're talking about.

> But then you'd need ". /etc/bashrc" in all user ~/.bashrc.


That's problem I've just solved by using a custom shell script that wraps around bash?


> I was hoping 
> there was some magical mechanism that would apply systemwide.
> 

Not according to the manpage. I wonder why they haven't built in a feature like this, seems pretty trivial to me... I still like my solution though, because it allows you to select which users adhere to /etc/bashrc and which not. For example, for root it may have unexpected consequences due to what's being read from /etc/bashrc.


Glenn


More information about the arch-dev-public mailing list