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

Re: PATH_DIRS



Hi Ray,

On Wed, Aug 16, 2017 at 11:22 AM, Ray Andrews <rayandrews@xxxxxxxxxxx>
wrote:

> On 15/08/17 10:32 AM, Bart Schaefer wrote:
>
>> On Tue, Aug 15, 2017 at 9:50 AM, Jim <linux.tech.guy@xxxxxxxxx> wrote:
>>
>>> Nothing, as far as I can tell.  I believe it is your point of view what
>>> PATH_DIRS is doing.  As long as "somescript" is in your PATH,
>>> I don't believe PATH_DIRS is doing much if anything.
>>>
>> Right, I got a bit confused about what Ray was asking
>>
> Sometimes even the question contains errors, so thereyago  we can't expect
> mindreading.
>
> At the end of the day all I want is for whence to show me sourcable
> scripts as well as +x scripts.  Since sourcable scripts are found and run
> according to PATH etiquette  (although the current dir is also always
> searched and we have the PATH_DIR option as well) I want whence to inform
> me what command will be run if I type it and press enter:
>
> snip ...

I am having a problem with the above statement, in particular the part
"although the current dir is also always searched".  To source a script
you can use one of two builtins, "." or "source". According to the man
page, for the "." builtin:

"Files in the current directory are not read unless `.' appears somewhere
in $path."

For the "source" builtin:

"Same as `.', except that the current directory is always searched and is
always searched first, before directories in $path."

As all examples in this email thread were using the "." builtin the above
statement didn't make sense to me. To be honest, until I reread the man
page, I always thought that both builtins were doing the same identical
thing. Learned "my" something new for today.

Hopefully I did not misreading what you were trying to state.

Jim


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