/etc/bash.d
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Hello,
two-line summary:
I propose to create a /etc/bash.d/ directory for files that need to be read when starting a non-login shell.
longer version:
Files in /etc/profile.d/ are sourced for _login shells_ (in other words: whenever /etc/profile is read). That works fine for setting environment variables (which are exported to child processes, including shells), but breaks for things like bash completion because those aren't inherited to non-login shells.
If you don't know the difference:
su - $USER # will give you a login shell
bash # will give you a non-login shell
If you open a "normal" (non-login) shell, the files in /etc/profile.d/ are _not_ read. This means that various bash completions are not available.
I propose to create a /etc/bash.d/ directory for files that need to be read when starting a non-login shell.
This adds the advantage of having a *.d directory where you can just drop in a file and it is used.
I never used a different shell, therefore I have no idea if we'll need a /etc/tcsh.d/, /etc/ash.d/, /etc/zsh.d/, ... directory - feedback on this (and of course on the /etc/bash.d/ proposal) is welcome ;-)
bash (4.3-7ubuntu2) utopic; urgency=medium
* Source profile.d from /etc/bash.bashrc to allow packages ship
integration hooks into interactive shells, same ones they already ship
for login shells. (Closes: #675008)
-- Dimitri John Ledkov <email address hidden> Wed, 07 May 2014 12:12:04 +0100