From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28065 invoked by alias); 6 Nov 2014 21:53:08 -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: 19354 Received: (qmail 28419 invoked from network); 6 Nov 2014 21:53:05 -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,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=cXu4iRtHBw9dpgrFaWwLw6sx6FDRSMvrDPwo2qno3Oc=; b=gH6/MHd0/AqWzXoYioSoDUfCYYMzaZLzXT8mAsoymyXXjr5fxHNYZcf6aV3KVJdDSR etY4Nxib8WIYIIKaRuWOC/aH6TyPfK5ZLqKxZLcoXXUk/XWscAU9HQwCVfBjOgqRrV3z 5pO6ahVNskASROjcSWfQWl5tayWAqsdaPcvL4n8tEIpxyFZXfdJyREdQttesAGwZgYKE NN9RSYHfpXb2/iQEXr0V51v7/0gvVb9XGViu5iqC8bZFlJ9bphXTHwOqszsnRrNTJHs7 1cxop7GlAusjRJ4Ljfq/Y6PEwImSP2dYC+hn8znrk0TuxIu8hjT2VjjwqsjQzqZHX+nm Qb1A== X-Gm-Message-State: ALoCoQlrxEL3e5+aETiZJMgVp52GDEJkArQ079c8ef/WZuilv5ovgJdAi0TsoPZd95nYhWMafICo MIME-Version: 1.0 X-Received: by 10.224.88.134 with SMTP id a6mr11218188qam.28.1415310780574; Thu, 06 Nov 2014 13:53:00 -0800 (PST) In-Reply-To: <545BEC0F.8080805@eastlink.ca> References: <545A6D66.3080500@eastlink.ca> <1458.1415209763@thecus.kiddle.eu> <20141105180035.22f6e9b1@pwslap01u.europe.root.pri> <141105204330.ZM2973@torch.brasslantern.com> <545BEC0F.8080805@eastlink.ca> Date: Thu, 6 Nov 2014 13:53:00 -0800 Message-ID: Subject: Re: 'whence' question From: Bart Schaefer To: Zsh Users Content-Type: multipart/alternative; boundary=001a11c2bbba52c72e050737b894 --001a11c2bbba52c72e050737b894 Content-Type: text/plain; charset=UTF-8 On Thu, Nov 6, 2014 at 1:45 PM, Ray Andrews wrote: > 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. > A "regular glob" and a pattern aren't significantly different, but for example you can't use (most) glob qualifiers in a pattern, and the meaning of "/" is very different. Note that "whence" is not a file search tool; scanning a hash table of alias names with a glob comparing file type or modification time would make no sense. 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. Interesting, it worked very nicely for me even as far back as zsh-4.2.6 on an ancient virtual machine: % whence -vsa ${(k)commands[(I)zsh*]} zshenv not found zsh is an alias for zsh-4.2.6 zsh is /usr/local/bin/zsh -> /bin/zsh zsh is /bin/zsh zsh.old is /bin/zsh.old zshrc not found zsh-4.2.0 is /bin/zsh-4.2.0 zsh-4.2.3 is /bin/zsh-4.2.3 zsh-4.2.5 is /bin/zsh-4.2.5 zsh-4.2.6 is /bin/zsh-4.2.6 That should find all the names in the command hash table that begin with zsh, and then pass them all to whence to find the full paths. I'm not sure why zshrc and zshenv are in the command hash table. --001a11c2bbba52c72e050737b894--