From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26468 invoked by alias); 2 Jul 2016 23:56:48 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21725 Received: (qmail 8806 invoked from network); 2 Jul 2016 23:56:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 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= Authentication-Results: mxback1j.mail.yandex.net; dkim=pass header.i=@yandex.ru From: "Nikolay Aleksandrovich Pavlov (ZyX)" To: TJ Luoma , Zsh-Users List In-Reply-To: References: Subject: Re: Sub-folders in $PATH? MIME-Version: 1.0 Message-Id: <104541467503446@web9j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sun, 03 Jul 2016 02:50:46 +0300 Content-Transfer-Encoding: 7bit Content-Type: text/plain 03.07.2016, 01:16, "TJ Luoma" : > 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`.