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

Re: environment settings



On Tue, Jun 17, 2008 at 03:11:54PM +0200, Vincent Lefevre wrote:
> On 2008-06-17 13:58:34 +0100, Stephane Chazelas wrote:
> > Changing the behavior of every zsh instance, even the instances
> > that run script that you've not written is very bad practice
> > IMO especially when you consider that the behavior is only
> > affected for the processes that have your euid.
> 
> If scripts I've not written expect that [some program] is available
> in $PATH, then the user may need to add directories to $PATH in his
> .zshenv (e.g. because [some program] has been installed by the user
> himself in his home directory).
[...]

So, you have a script that expects a $PATH that is different
from the system's $PATH, and your solution is to update the
~/.zshenv for every user that is meant to run that script, and
by doing so, possibly affecting the behavior of all the other
zsh scripts that those users may run?

It seems to me that the /right thing/ would be to update the
script (or write a wrapper that sets $PATH if it's a binary file
instead of a script), or update the system's $PATH. But you can
always put it in ~/.zshenv if you can't be bothered or if you
don't have the right to update the system's $PATH.

Moreover, if you do

path+=(/some/path)
in ~/.zshenv, you'll soon end up with /some/path dupplicated.

-- 
Stéphane



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