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

Re: ~/.zshenv or ~/.zprofile



In the last episode (Sep 08), DervishD said:
>  * Dan Nelson <dnelson@xxxxxxxxxxxxxxx> dixit:
> > 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.
> 
> Well, that was my doubt ;))
>  
> > path=(/usr/local/bin
> > typeset -U PATH
> 
> Good solution! Just one more question: if the user runs, as in the
> example, 'PATH=whatever gdb program', this is because the user wants
> JUST that path, no more, no less. Shouldn't be a better approach
> something like:
> 
>     [[ -z "$path" ]] && path=(mypath $path)
>     typeset -U path

That won't work because cron and /usr/bin/login give you a minimal
PATH.  You could have it test another variable like "NODEFAULTPATH" or
something.

-- 
	Dan Nelson
	dnelson@xxxxxxxxxxxxxxx



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