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

Re: [zsh] zsh startup files



In the last episode (Mar 14), Francisco Borges said:
> On Tue, Mar 14, 2006 at 05:38PM +0000, zzapper wrote:
> > At the risk of exposing my ignorance, I think there's a concept of
> > multi-level startup files of type .z* such that ideally you don't
> > have rerun all your setup every time you run say a small 3 line
> > script.
> >
> > I've got everything in my ~/.zshenv can I do better?
> 
> There is also .zlogin and .zshrc.
> 
> You should move all the "interactive" part of your .zshenv into
> .zshrc, i.e. anything that you won't need to run your scripts. My
> zshenv is mostly about setting $PATH and other non interactive env.
> variables.

I alwys put one of the following comments at the top of my startup
scripts so I remember what goes where, and in what order:

# .zprofile -- loaded if login shell        .zshenv .zprofile .zshrc .zlogin
# .zshenv -- always loaded                  .zshenv .zprofile .zshrc .zlogin
# .zshrc -- loaded if interactive shell     .zshenv .zprofile .zshrc .zlogin

The comments at at the top of the example scripts also have good
descriptions of what should go into what script.
 
-- 
	Dan Nelson
	dnelson@xxxxxxxxxxxxxxx



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