From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10567 invoked by alias); 6 Nov 2014 21:12:37 -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: 19353 Received: (qmail 18867 invoked from network); 6 Nov 2014 21:12:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Authority-Analysis: v=2.1 cv=AduIQRnG c=1 sm=1 tr=0 a=WaDuc+ZEBMlF3jy0Tbv8PA==:117 a=WaDuc+ZEBMlF3jy0Tbv8PA==:17 a=G8GL833Es-AA:10 a=N659UExz7-8A:10 a=go5n2Ott6v_NHKPJS5UA:9 a=E-u0C1wSkdhBbMfW:21 a=B6WwGUzwqyfC5ojP:21 a=pILNOxqGKmIA:10 Message-id: <545BEC0F.8080805@eastlink.ca> Date: Thu, 06 Nov 2014 13:45:51 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: 'whence' question References: <545A6D66.3080500@eastlink.ca> <1458.1415209763@thecus.kiddle.eu> <20141105180035.22f6e9b1@pwslap01u.europe.root.pri> <141105204330.ZM2973@torch.brasslantern.com> In-reply-to: <141105204330.ZM2973@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 11/05/2014 08:43 PM, Bart Schaefer wrote: > The pattern accepted by the -m option is not a glob, That seems very counterintuitive! I'm taking it as a regular glob just as, I think, anyone would. > it's a pattern of > the string-matching variety. If we were to simply glue each of the > arguments onto the end of each $path directory and glob the resulting > cross-product, the wrong results could be returned. Furthermore, for > e.g. cygwin, the filled hash table has dealt with mapping "foo.exe" > onto "foo" with the suffix case-insensitive, so even a string match > against the file names across $path could be wrong. > > Having just written that, it occurs to me that perhaps the "right way" > is the equivalent of this? -- > > whence -a ${(k)commands[(I)pattern]} I couldn't get any love from that. What I do in my wrapper is this: echo -e "\n\e[31;1mACTIVE:\n\e[0m`whence -mv "$1"`" echo -e "\n\e[31;1mSHADOWED AND/OR LINKS:\ \n\e[0m`whence -sav "${1//'*'/}"`" > $ i zsh* << (i)nformation = mostly from whence. > ACTIVE: > zsh is /usr/local/bin/zsh > zsh-ok is /usr/local/bin/zsh-ok > zsh-test1 is /usr/local/bin/zsh-test1 > zsh-test2-orig-rebuild is /usr/local/bin/zsh-test2-orig-rebuild > > SHADOWED AND/OR LINKS: > zsh is /usr/local/bin/zsh -> /usr/local/bin/zsh-test2-orig-rebuild > zsh is /usr/bin/zsh -> /usr/local/bin/zsh-test2-orig-rebuild > zsh is /bin/zsh -> /usr/local/bin/zsh-test2-orig-rebuild > ... which is a bit clumsy, but if I type ' i zsh* ' I want 'whence-ish' information on the intuitive meaning of 'zsh*' and I want to see links, and 'shadowed' files because they may very well be part of a chain of links, as is true above. But '-m' won't permit '-s', and '-a' won't permit glob. I hope that something more friendly can be come up with. I hope it's " whence -as "zsh*" "