Zsh Mailing List Archive
Messages sorted by:
- X-seq: zsh-users 22823
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: PATH_DIRS
- Date: Sun, 13 Aug 2017 20:20:05 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ZGqW0C0v7Yzh72CQHVnCLUH6ePsDbdHeeTXGm6jXNZs=; b=jqGbwFzGRXYiihUm4jl1cNvUGwKci61qKOcZBhca77LMb7if9Ssmc+ETZzb8uEpZxW lPVqRZPb72si8y+Ldtb8oJAD7QOa1dupO+mp4FdRKw/QMXLdFoOHmNjVX5tt5SbCsERz ExhvSY3+SfD4A+6koatrNZiUH6L+ZWfLlqWUQy7rxGNL/UKElHsMF4DSuM6jOPjVdQKN Iiv2J9OsZ6ID5iY3CMT6PaoudV/kj6FZ9BmPZ4l7QezHw23cSvIthiBe+KJwkgh2jQJM L5w0ZgxG08wAIsK7ESwPBEgBJBOpBIdxZdQYBLfJVVH3XBFcYFzhgswaZYfXSYAsthZO fEHQ==
- In-reply-to: <email@example.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <firstname.lastname@example.org> <CAH+w=7Yd0O2_KqXe84X95-zgLFZOoCzLPKMWUrkT6hGh4jf8Ww@mail.gmail.com> <email@example.com>
On Thu, Aug 10, 2017 at 10:07 PM, Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> On 10/08/17 03:19 PM, Bart Schaefer wrote:
>> 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).
> However, scripts are run even if chmod -x, tho whence will only find them if
> '+x'. Am I somehow missing the boat there?
You're confusing scripts read with the "." (or "source") commands with
programs that are found by path search where the program happens to be
That is, with or without PATH_DIRS set, if you have a script named
"myscript" in a directory in $PATH and you chmod +x it, then you can
run it by just typing "myscript" in command position, without
prefixing it by ". ". With PATH_DIRS set, you can run ". myscript"
with or without that executable permission on the file (it need only
When I said:
>> What it WON'T do is source scripts it finds that way into the current
By "that way" I meant "path search where the program happens to be a
script." Obviously (I hope), the "." command always does source
things into the current shell.
> I find myself wanting whence to find anything that is executable on the PATH.
Some people use "chmod +x" on scripts exactly for this reason, whether
they intend to always run them via the "." command or not.
Messages sorted by: