Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh startup files

>>>>> "Bart" == Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> writes:
> The problem with this is that, for example, settings in /etc/zshrc may
> depend upon settings performed earlier.  The idea behind interleaving the
> user and system init files is so that, at each decision point in the
> system administrator's initialization chain, the user gets a chance to
> step in and change the details with his own initialization.

Sounds nice in theory, but how about practice ?
In my world, /etc/zshrc is normally designed to work in the environment setup
by /etc/zshenv and /etc/zprofile and if people add things in their ~/.zshrnv or
~/.zprofile, two things can happen: either the change is orthogonal to the
sysadmin's settings so there's no interaction, or there's some interaction and
it then tendfs to break the subsequent /etc/zshrc (or the /etc/zshrc just
undoes the~/.zprofile's settings).
Could you give a (few) example(s) where the interleaving is beneficial ?

> The order in which the files are sourced is designed to make it easy for
> a user who wants to make *minimal* changes to the system-wide defaults.
> If all I care about is changing one setting that's in /etc/zprofile, I

It seems it just makes it easy to make changes that don't have the intended
effect because other code is executed afterwards.

> If the ordering is as you just proposed, then in order to fix that one
> zprofile setting I may have to duplicate large sections of /etc/zshrc and
> /etc/zlogin in my .zshrc and .zlogin (or source them again, which might
> break in some other way).

Again a (few) example(s) of when this might happen would come in handy.
I never came across any such situation.

> make it work.  Many choices in the early days of zsh were made so that
> it would be easy for a novice, even if that made it noticably harder for
> an expert.

Ignoring NO_RCS after /etc/zshenv doesn't seem to make anything easier for
novices but does seem to make things much harder for the experienced user.

> (3) Use "exec" in .zshenv or .zprofile as I described above.

Note that this `exec' solution cannot be used for the case of commands
executed from `rsh'.


Messages sorted by: Reverse Date, Date, Thread, Author