Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Can $PATH look into sub-folders?
- X-seq: zsh-users 26977
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh MailingList <zsh-users@xxxxxxx>
- Subject: Re: Can $PATH look into sub-folders?
- Date: Wed, 25 Aug 2021 15:51:33 +0100 (BST)
- Archived-at: <https://zsh.org/users/26977>
- Importance: Medium
- In-reply-to: <CADjGqHuCCN8u2-WG5XAmrrwynh__BDV=PLH4qe+F1akf_7SPBA@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CADjGqHuCCN8u2-WG5XAmrrwynh__BDV=PLH4qe+F1akf_7SPBA@mail.gmail.com>
> On 25 August 2021 at 15:17 TJ Luoma <luomat@xxxxxxxxx> wrote:
> It is my understanding the zsh (and others) do not usually look into
> sub-folders of $PATH for commands.
>
> For example, if /usr/local/bin/ is in my $PATH and I have a folder
> /usr/local/bin/private/ then zsh would not ‘see’ any scripts/utilities/etc
> that were in /usr/local/bin/private/ unless I specifically added
> /usr/local/bin/private/ to my $PATH.
>
> That seems to be my experience, at least.
>
> My question is whether or not there is an option (a zsh-specific option is
> fine) which would tell zsh to include sub-folders of $PATH folders without
> having to explicitly add them all to $PATH.
The only choices I can see are:
Firstly, set the PATH_DIRS option and refer to them by relative path, i.e.
private/...
Secondly, use recursive globbing to add the directories to path, so at
least you don't need to do that explicitly. In other words,
path+=(/usr/local/bin/**/*(/))
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author