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

Re: PATH_DIRS



On Thu, Aug 10, 2017 at 2:46 PM, Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> Noticing how PATH_DIRS behaves in a way parallel or complementary to PATH, I
> wonder if whence might be tweaked to search for scripts on PATH_DIRS

PATH_DIRS is a setopt, it *uses* $PATH.  It's not a parameter
providing alternate directories.

Anyway, it already does search like that.  You just have to chmod +x
the script files (and add a #! line if they aren't zsh scripts).

What it WON'T do is source scripts it finds that way into the current
shell.  It'll always fork a subshell for them.  Too many opportunities
for mayhem if the user hasn't explicitly asked (via the "." command)
to have his current shell altered (potentially) by the script.



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