Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Sub-folders in $PATH?
- X-seq: zsh-users 21725
- From: "Nikolay Aleksandrovich Pavlov (ZyX)" <kp-pav@xxxxxxxxx>
- To: TJ Luoma <luomat@xxxxxxxxx>, Zsh-Users List <zsh-users@xxxxxxx>
- Subject: Re: Sub-folders in $PATH?
- Date: Sun, 03 Jul 2016 02:50:46 +0300
- Authentication-results: mxback1j.mail.yandex.net; dkim=pass header.i=@yandex.ru
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1467503447; bh=VB9EGgGwdM0Gb4J5h1tkERDdw50ozuoCtkJcDiaZiT0=; h=From:To:In-Reply-To:References:Subject:MIME-Version:Message-Id: X-Mailer:Date:Content-Transfer-Encoding:Content-Type; b=mkZWhzp512HUdwJTJdQ25i4qnNBs6cpZir7i1lWputKB/3sQJqUpXDmwp4/fBDDtl 66H3ex7peyCvB1zwoYElkPANlhjmOwlow+75OfRGfSc/7xZ5EvEs5Y5yNnxUPyNu58 TNQ42d6N1xMdVaBOEtPCk066WuWR68M8m8xlymVc=
- In-reply-to: <CADjGqHtZ61wcSaL_SEKT7Kw=6DpByp9=mdz1eZbYyvgA8QCAZQ@mail.gmail.com>
- 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: <CADjGqHtZ61wcSaL_SEKT7Kw=6DpByp9=mdz1eZbYyvgA8QCAZQ@mail.gmail.com>
03.07.2016, 01:16, "TJ Luoma" <luomat@xxxxxxxxx>:
> Is there an option to have subfolders in a $PATH folder searched as well?
>
> For example, if I wanted to put some folders in /usr/local/bin/scripts/
> without explicitly adding /usr/local/bin/scripts/ to $PATH
> (assuming /usr/local/bin/ was already in there).
>
> TJ
If script names are unique you may employ command_not_found_handler function to do this job. Note though that this will work like you have all subfolders after all folders in $PATH, if e.g. there are executables `/usr/bin/scripts/foo` and `/usr/local/bin/foo` and `PATH=/usr/bin:/usr/local/bin` then implementing this functionality via command_not_found_handler will find `/usr/local/bin/foo` before considering `/usr/bin/scripts/foo`.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author