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

Re: /etc/profile being read after my personal .zshenv



On Nov 23, 10:22pm, Timothy J Luoma wrote:
} Subject: /etc/profile being read after my personal .zshenv
}
} How can I stop that?

You can't.

} I thought all systemwide files were read first, and then the personal ones.

Nope.  The order is:

 1	/etc/zshenv
 2  (NO_RCS is checked, and if set, no more are read.)
 3	$ZDOTDIR/.zshenv
    (The next two are skipped when not a login shell.)
 4	/etc/zprofile
 5	$ZDOTDIR/.zprofile
 6  (NO_RCS is checked again, and if set, no more are read.)
 7	/etc/zshrc
 8	$ZDOTDIR/.zshrc
    (The last two are skipped when not a login shell.)
 9	/etc/zlogin
10	$ZDOTDIR/.zlogin

Thus the only way to avoid /etc/zprofile on login shells is to also have
your own .zshenv skipped.  The best you can do is override /etc/zprofile
in your .zprofile.

A quick-n-dirty solution is to link .zprofile and .zshenv, and take the hit
of having the same file read twice on logins.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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