Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATH_DIRS
- X-seq: zsh-users 22830
- From: Jim <linux.tech.guy@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: PATH_DIRS
- Date: Tue, 15 Aug 2017 11:50:10 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to; bh=3zCkkGXK7c+KHclEe+zBT/DIVEy9euE/9ieFA1V/MrQ=; b=XPOUtU8/nZsNKA8XQlg/ja1xMM9nHftSkn1LpHzOGLA8O4cH6/p7YX1bmsf9KQnDiK 2u2bAX2ayY4bbpDuxEJAH+gEWOIzJGqje96fIlAFEfASu9sBTnCKxhS4g4TR2wMWObfG GHbDldlNCWFael8l9Y/Qkuh77eGKUfFBbANYjnzs6gL13d/0E0qVTxick0qDcN3syFer Cyb7PbvejkXBTZ52frB8RJtDbRUGtqVJoubjxMvM1MAKBbylOZj/bWCzWJmkE0kgsOfK BYEASlGTSYwvVdV7QguAq1hIeyxabPgnTwA0sINX4Qw48V+qrtxw1vPEOnFbZtS3o6De DmTA==
- In-reply-to: <95eb4234-b82c-f445-e21f-5fb99d689562@eastlink.ca>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <ff4bbb1d-10a9-d95f-a721-4afca5fdf95d@eastlink.ca> <CAH+w=7Yd0O2_KqXe84X95-zgLFZOoCzLPKMWUrkT6hGh4jf8Ww@mail.gmail.com> <1852003c-c07c-dc61-b863-007f0cef9111@eastlink.ca> <CAH+w=7bGeu_1rpQTE3S_a9HXYMNk0i_ByaSxxwrD01zp7N=hmw@mail.gmail.com> <95eb4234-b82c-f445-e21f-5fb99d689562@eastlink.ca>
- Reply-to: linuxtechguy@xxxxxxxxx
Hi Ray,(Sorry if you get this twice, forgot to send to list the first time.)
On Mon, Aug 14, 2017 at 10:53 PM, Ray Andrews <rayandrews@xxxxxxxxxxx>
wrote:
> On 13/08/17 08:20 PM, Bart Schaefer wrote:
>
>> With PATH_DIRS set, you can run ". myscript"
>> with or without that executable permission on the file (it need only be
>> readable).
>>
>
> Then how do I get these results?:
>
> /aWorking/Zsh/Source 3$ unsetopt pathdirs # This directory is not
> on the path
>
> /aWorking/Zsh/Source 3$ chmod -x ../System/somescript # Referring
> here to somescript which is on the path.
>
>
> snip ...
>
> ... what am I doing wrong
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.
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author