From: Jim <linux.tech.guy@gmail.com>
To: zsh-users@zsh.org
Subject: Re: PATH_DIRS
Date: Tue, 15 Aug 2017 11:50:10 -0500 [thread overview]
Message-ID: <CA+rB6G++wGcaFd2Qrs0Y1nVZW9i80bjCvzHT6khBY83uHuALdg@mail.gmail.com> (raw)
In-Reply-To: <95eb4234-b82c-f445-e21f-5fb99d689562@eastlink.ca>
[-- Attachment #1: Type: text/plain, Size: 1614 bytes --]
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@eastlink.ca>
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
next prev parent reply other threads:[~2017-08-15 16:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-10 21:46 PATH_DIRS Ray Andrews
2017-08-10 22:19 ` PATH_DIRS Bart Schaefer
2017-08-11 5:07 ` PATH_DIRS Ray Andrews
2017-08-11 16:12 ` PATH_DIRS Ray Andrews
2017-08-14 3:20 ` PATH_DIRS Bart Schaefer
2017-08-15 3:53 ` PATH_DIRS Ray Andrews
2017-08-15 16:50 ` Jim [this message]
2017-08-15 17:32 ` PATH_DIRS Bart Schaefer
2017-08-16 16:22 ` PATH_DIRS Ray Andrews
2017-08-20 10:59 ` PATH_DIRS Jim
2017-08-20 16:50 ` PATH_DIRS Ray Andrews
[not found] ` <CA+rB6GL7tv+_tyswyZYFLksy_+oQ4Nk8ZQ9FRDW8h1dfnKdUgw@mail.gmail.com>
2017-08-16 14:45 ` PATH_DIRS Ray Andrews
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+rB6G++wGcaFd2Qrs0Y1nVZW9i80bjCvzHT6khBY83uHuALdg@mail.gmail.com \
--to=linux.tech.guy@gmail.com \
--cc=linuxtechguy@gmail.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).