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

Re: ~/.zshenv or ~/.zprofile



On 2003-09-07 at 22:27 -0500, Dan Nelson wrote:
> My global path settings are in zshenv, because that's the only one read
> from scripts when your original login shell wasn't zsh and from cron
> jobs.

Similarly, I want to be able to do:
% ssh some-host command-in-company-bin-dir -oPts |less
and not have to worry about paths.

So I use zshenv, since it's the only pair of files sourced to set
variables.

If I'm going to worry about things like gdb, then I'll wrap the $path
setting inside a $SHLVL test -- if $SHLVL is set and is greater than or
equal to 2, then, and only then, assume that $PATH has been set
appropriately on this host.

Would fail when invoking zsh from a bash shell, were it not that I tend
to "exec zsh", which doesn't increase $SHLVL.
-- 
2001: Blogging invented. Promises to change the way people bore strangers with
banal anecdotes about their pets. <http://www.thelemon.net/issues/timeline.php>



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