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

RedShift redshift at pandora.be
Tue Aug 25 04:51:45 EDT 2009


Thomas Bächler wrote:
> This problem has been bugging me for some time: /etc/profile is only 
> read for login-shells. That is fine, because you launch a login-shell 
> once, then start your graphical environment from it. Most of the 
> environment is persisitent so that it will appear in X terminals (which 
> only launch interactive non-login shells).
> 
> However, if you launch an interactive shell, the following is lost:
> * PS1, PS2
> * all aliases
> * /etc/bash_completion
> 
> So, I have to set up the bashrc of every user to restore PS1, PS2, my 
> custom aliases and bash_completion. Is there a solution to this is in 
> something like a "system-wide bashrc"? The current way is really 
> inconvenient.
> 

Maybe do something like this?

/usr/bin/bash2:
#!/bin/bash
bash --rcfile /etc/bashrc

and then

echo "/usr/bin/bash2" >> /etc/shells
usermod -s /usr/bin/bash2 myuser


Glenn


More information about the arch-dev-public mailing list