From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17617 invoked by alias); 5 Jul 2016 09:14:52 -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: 21731 Received: (qmail 22306 invoked from network); 5 Jul 2016 09:14:52 -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 autolearn=ham autolearn_force=no version=3.4.1 Date: Tue, 5 Jul 2016 11:14:46 +0200 From: Roman Neuhauser To: Daniel Shahaf Cc: Johan DS , TJ Luoma , Zsh-Users List Subject: Re: Sub-folders in $PATH? Message-ID: <20160705091446.GW3514@isis.sigpipe.cz> References: <20160705045753.GA8004@tarsus.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160705045753.GA8004@tarsus.local2> User-Agent: Mutt/1.5.24 (2015-08-30) # d.s@daniel.shahaf.name / 2016-07-05 04:57:53 +0000: > Johan DS wrote on Sun, Jul 03, 2016 at 01:26:06 +0200: > > export > > PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin: > > [[ -d ~/bin ]] && export PATH=${PATH}:$(find ~/bin -type d | tr '\n' ':' | > > sed 's/:$//') #include all ~/bin/subdirs > > Another way of doing the same thing: > > path+=( > /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin > ~/bin/**/*(/N) > ) > > (unlike Roman's solution this uses ** to be equivalent to the find(1)) yeah, sorry about that, i *meant* to use recursive glob. -- roman