From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28108 invoked by alias); 25 Mar 2014 03:10:31 -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: 18672 Received: (qmail 28089 invoked from network); 25 Mar 2014 03:10:23 -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=HYUtEE08 c=1 sm=1 tr=0 a=KhC7qsGhzDEkHm9aGCnVLg==:117 a=KhC7qsGhzDEkHm9aGCnVLg==:17 a=4bV_df75LxsA:10 a=8nJEP1OIZ-IA:10 a=_ofAcnSGPNV8bTdtU-QA:9 a=wPNLvfGTeEIA:10 Message-id: <5330F3B0.7030704@eastlink.ca> Date: Mon, 24 Mar 2014 20:10:40 -0700 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Icedove/24.3.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: 'whence' anomaly. References: <53307744.9070008@eastlink.ca> <140324154811.ZM4815@torch.brasslantern.com> In-reply-to: <140324154811.ZM4815@torch.brasslantern.com> Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit On 03/24/2014 03:48 PM, Bart Schaefer wrote: > On Mar 24, 11:19am, Ray Andrews wrote: > } > } What causes this: > } > } > $ whence -m mplayer > } > > } > $ whence mplayer > } > /usr/bin/mplayer > } > > } > $ whence -m mplayer > } > /usr/bin/mplayer > > I guess you could think of it as both/either a bug and/or a feature ... > > "whence -m" searches, but does not populate, the command hash table. > Thus if the NO_HASH_CMDS option is set, "whence -m" does not work > at all. [*] > > "whence" populates the hash table as a side-effect of searching $PATH, > presuming HASH_CMDS is set; but it might not fully populate the table > if HASH_DIRS is set, so "whence -m" of a different command from later > in the $PATH might still fail. > > [*] Except that the CORRECT option also relies on the hash table, so > if that is set, as soon as anything might need correcting, the table > gets filled, and "whence -m" will start working again. > Yikes, more ifs buts and maybes. Is there some way to get a reliable result? AFAICT, none of the options you mention are set here (that's from scanning the output of " $ set "). Should I always make a double call?: " $ whence mplayer; whence -m "mplayer" ? Set some option?