From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6174 invoked by alias); 24 Mar 2014 22:48: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: 18670 Received: (qmail 17351 invoked from network); 24 Mar 2014 22:48:31 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140324154811.ZM4815@torch.brasslantern.com> Date: Mon, 24 Mar 2014 15:48:11 -0700 In-reply-to: <53307744.9070008@eastlink.ca> Comments: In reply to Ray Andrews "'whence' anomaly." (Mar 24, 11:19am) References: <53307744.9070008@eastlink.ca> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: 'whence' anomaly. MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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.