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

Re: PATH_DIRS



On 15/08/17 07:30 AM, Jim wrote:
Hi Ray,

Try the following to understand what PATH_DIRS can do:

  mkdir ../System/Subdir
  mv ../System/somescript ../System/Subdir
  unsetopt pathdirs
  . Subdir/somescript       # script should not run
  setopt pathdirs
  . Subdir/somescript       # should see output from script

I believe from reading the man page, this is what PATH_DIRS is
intended to do.  As Bart said, it *uses* PATH. If you +x somescript
you can just type:

  Subdir/somescript

At least this is how I interpreted what PATH_DIRS, as defined in the man
page, does.  "Perform a path search even on command names with
slashes in them."  Maybe it should say, "In addition to the normal path
search, preform a path search on command names with slashes in them."
Maybe I'm missing some other case use.

Hope this helps.

Jim


Hugely, thanks Jim. The doc frankly baffled me, now I get it, it adds subdirectories of the path to the (effective) path. Why not just say that? Seemed to be talking about slashes as parts of filenames or some such voodoo. Now Bart's "uses PATH" is understandable. Darkest just before dawn!




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