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

Re: ~/.zshenv or ~/.zprofile



On Sun, Sep 07, 2003 at 10:57:10AM -0700, Wayne Davison wrote:
> I'd like to change the StartupFiles/zshenv file so that it doesn't
> recommend setting the "path".

I've checked in an improved version of my zshenv file.  In addition to
some minor language improvments and the correction of an age-old
spelling error, I added a section that attempts to give advice to those
that want to use .zshenv to set their PATH.  Namely:

# Some people insist on setting their PATH here to affect things like ssh.
# Those that do should probably use $SHLVL to ensure that this only happens
# the first time the shell is started (to avoid overriding a customized
# environment).  Also, the various profile/rc/login files all get sourced
# *after* this file, so they will override this value.  One solution is to
# put your path-setting code into a file named .zpath, and source it from
# both here (if we're not a login shell) and from the .zprofile file (which
# is only sourced if we are a login shell).
if [[ $SHLVL == 1 && ! -o LOGIN ]]; then
    source ~/.zpath
fi

Seems like a pretty good solution to me -- do you agree?

Finally, I'd like to know how to get the zsh.org web sites to update
with the new zshenv?  Does this happen automatically?

..wayne..



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