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

Re: bug with empty path



Zoltan Hidvegi wrote:
> Peter Stephenson wrote:
> > The lines:
> >   path=()
> > and
> >   PATH=
> > have different effects: the first produces an empty path array, the
> > second a path with one blank element.  This turns up in the following:
> 
> I do not think it is a bug.  Of course other shells couldn't set an empty
> path but zsh is better than that.  The path is really an array and the PATH
> scalar is just a representation which has this inefficiency.
> 
> One may want to use a really empty path sometimes which is best achieved
> with path=().

I see the point, but do you really want to try and explain this to the
average user?  ``The PATH is sometimes empty, and sometimes really empty,
but only if you set it as an array; if it looks empty, it may be empty
or really empty; if it's empty but not really empty it pretends to be
set to the current directory...''

Besides which, when passed as an environment variable --- even down to another
zsh --- the only possibilities are either not having it set or an empty
PATH (which is therefore not really empty in the above sense).

Still, there's some confusion in having both $path and $PATH which is
probably unavoidable, so I can live with it.

-- 
Peter Stephenson <pws@xxxxxx>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77413
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



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