Hello, Am Freitag, 7. Dezember 2012 schrieb Dr. Werner Fink:
On Tue, Dec 04, 2012 at 08:50:05PM +0100, Christian Boltz wrote:
we have /etc/profile.d/ (read when a _login shell_ is started) which works for setting environment variables, but fails for things like completion that must be read whenever a new (non-login) shell is started.
The correct solution would be to have a) /etc/profile.d/ - setting up environment variables, read for login shells
b) /etc/bash.d/ [1] - files that are read whenever a bash is started.
c) /usr/share/profile.d/ and /usr/share/bash.d/ [3] as counterparts to the directories in /etc.
Afterwards, we could - "cleanup" /etc/profile.d/ - some of the files should live in /etc/bash.d - drop various ". $foo" workarounds from /etc/bash.bashrc
What do you thing about this proposal?
Hmmm ... the /etc/bash.bashrc is also for other bourne shells around therefore I'd like to know why now we want to move all parts below /etc to /usr/share ... those files are potenial editable and for me those files are (potential) configuration files.
I know that those files are potential editable, but OTOH most users will never edit them. That's why I proposed to move them to /usr with the option to override them in /etc. The reason is to keep default/unchanged stuff out of /etc so that the really changed/overridden files are better visible. That's one of the concepts of systemd that I like and that works quite well ;-) That said, the most important thing is to separate profile.d and sh.d. Moving to /usr/ is "just" additional cleanup - but we could get it nearly "for free" when moving around files between profile.d and sh.d.
[3] Directory names are only proposals, feel free to propose better ones> [4] untested: for file in /usr/share/bash.d/* ; do test -f /etc/bash.d/$(basename $file) && continue
/etc/bash.d/${file##*/}
Does this work for all shells or only for bash? (Besides that, the code was just a first, untested proposal.)
. $file done
This one I like ... nevertheless this requires a README below /usr/share/sh.d/ or /usr/share/profile.d/ to point out to copy a file from this directory to /etc/sh.d/ or /etc/profile.d/
Yes, documentation is always a good idea ;-)
Please note that the files should show the correct suffix that is
*.sh for all bourne shells *.ash for the ash *.bash for the bash *.dash for the dash *.ksh for the ksh *.csh for all csh shells *.tcsh for the tcsh
this would help a lot. Most times this will be *.sh and *.csh but for special cases like shell specific languages the other suffixes should be used.
Indeed, using suffixes is a good method. (This also means one directory ("sh.d") is enough - no need for "bash.d" etc. as I initially proposed.) Do you have a good idea how to name the directories in /usr? You mentioned /usr/share/profile.d and /usr/share/sh.d which is not too bad - but IMHO both should have a common parent directory. Maybe /usr/share/shells/profile.d and /usr/share/shells/sh.d?
Also for enviroment only the profile.d trees should be used to do this only once for a login shell, e.g. the shell used for an X session.
Yes, of course. The missing separation between profile.d and sh.d is basically a bug, and getting it fixed was the initial reason for my proposal. How can we continue? AFAIK you have a very good overview over all shells, so you are probably the best person to lead and/or implement this ;-) If you want, I can help on the bash side. Be warned that I don't know anything about other shells. This also means I don't want to break tcsh or ksh ;-) and will leave this up to you or another volunteer. First technical question: Does any shell directly read /etc/profile.d/ or do they all read it indirectly via /etc/profile and /etc/*shrc? Regards, Christian Boltz --
Ich versuchs mal so zu sagen: Ich versuche gerade, dich laaaangsam ins kalte Wasser zu schubsen. ich mag kein kaltes Wasser, las uns die weiteren Tests nach Playa de Santiago verlegen, da dürfte das Wasser jetzt ca. 20° C haben. [> Ratti und Gerald Goebel in fontlinge-devel] -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org