zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: PATH_DIRS
Date: Thu, 10 Aug 2017 15:19:47 -0700	[thread overview]
Message-ID: <CAH+w=7Yd0O2_KqXe84X95-zgLFZOoCzLPKMWUrkT6hGh4jf8Ww@mail.gmail.com> (raw)
In-Reply-To: <ff4bbb1d-10a9-d95f-a721-4afca5fdf95d@eastlink.ca>

On Thu, Aug 10, 2017 at 2:46 PM, Ray Andrews <rayandrews@eastlink.ca> 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.


  reply	other threads:[~2017-08-10 22:20 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 ` Bart Schaefer [this message]
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         ` PATH_DIRS Jim
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='CAH+w=7Yd0O2_KqXe84X95-zgLFZOoCzLPKMWUrkT6hGh4jf8Ww@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=rayandrews@eastlink.ca \
    --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).