System Wide Bash Login Script

Polytropon freebsd at edvax.de
Wed Dec 18 23:03:02 UTC 2013


On Wed, 18 Dec 2013 11:47:23 -0600, Graham Allan wrote:
> There's a compile-time option in config-top.h ("#define SYS_BASHRC 
> ..."), which nobody seems to use.
> 
> [...] I still don't understand why 
> bash people don't see the value in this feature - having to insert that 
> snippet into everybody's personal bashrc is just stupid IMO...

It sounds wrong, especially when you consult the documentation,
"man bash", down at the "FILES" section:

/etc/profile
       The systemwide initialization file, executed for login shells

The local file ~/.bashrc, used for interactive shells (that
don't have to be login shells) doesn't seem to have a global
equivalent.

When the shell is a login shell, this should be sufficient.
A similar "precedence mechanism" has been a useful thing
for the C shell for decades: /etc/csh.cshrc, /etc/csh.login
and /etc/csh.logout are being used system-wide, which means
that its settings can benefit everyone who has an _empty_
local configuration file; only changes need to be applied
locally, if intended, so system settings could be easily
"inherited" without requiring changes to users' dotfiles,
it was just required to make sure the skel/ subtree did
privde them with empty files (that they could change them-
selves if they wanted).




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list