From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26337 invoked by alias); 5 Apr 2018 00:20:34 -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: List-Unsubscribe: X-Seq: 23306 Received: (qmail 1481 invoked by uid 1010); 5 Apr 2018 00:20:33 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr0-f177.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.128.177):SA:0(-1.9/5.0):. Processed in 1.56311 secs); 05 Apr 2018 00:20:33 -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,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sIFlCUQWmVcNEgnEPWsrIyHeGZUMA6pAoRavrATUF8k=; b=fBXAZ5BoNcl/xuoEO8m/oVhNQ3H+QlGd9kn7qGubOJvqHEhnb7TACDMpLXYu4XcKDj mpEhPYS/KfdkUT50Y5uaWguJser6mtYkVNVDXWIBXQzjjPQ0AL/EaM96GILws2wb/0Y3 YFZvdkmtZtSS643wvCMjt7waLjmexWXW9ABx/s5f65wH7dt71M0Unh3YlaRoIs0XP5Mb fdy5Ys3JhFompJ7c0RDFr0pX5Ncx2ZhLFYWHnzw+2V88Gai1gbi2htsDfzl6HHoXKjT8 vj+Pk8rsrLCJ/RwX4g5Qt4iv9T2uYmDyl+0q6JIsbqqfShuARIQJjmDSpCGZfqWF9oG7 mzsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sIFlCUQWmVcNEgnEPWsrIyHeGZUMA6pAoRavrATUF8k=; b=R/RTdv9zLKhhy6ItuiRGsMoYm6+7FI4hHg3TEjNvfmheWUMSgAy4nPjhZvxtXO4TF6 tf2LhZUWxhrSsKnOw/qxGiWxALIwJtqxmS9ea5QUx+0ZxF4U2uQ18me/JJbtmG4X0omE VjrJFxly3De1c8XrE0vVSCoMbfqje3qAMj1rLNFsoEjnaF4ibbylnGTcU3n+d5jopr98 do8nZGh8b1YpBLclIxcMVIyXQbT5I+GxzjzhGNXXmNlNfh6Emt4XJIGbU4aQgCEkbxo/ 6UfchTpJUUF30U0eXXz+r2Jxw9g8CcmvEncFYXfeKA6DbeZmBMvj2Xmk/6t8dafz/e4L fLvg== X-Gm-Message-State: ALQs6tDSHiJ9DJVU2i9JHgASKhz5uCvCKXst1nxiMCoZDYVjofUWBDVL q77+koFpY3JdjL+fn/588iFd6Qafu+Dhq6OPb1Z15w== X-Google-Smtp-Source: AIpwx4+q8WBzg89XiN5ID5JGBbQqrUWCHE4RHybc1s9n/X4mMHxacEG4dR2webggKQiHS10lNyTJLUQqYUBYRNsRk0I= X-Received: by 2002:a19:53cf:: with SMTP id h76-v6mr12134460lfl.87.1522887628156; Wed, 04 Apr 2018 17:20:28 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180404181017.lcz74c4tyojz77ao@tarpaulin.shahaf.local2> References: <6935145d-785f-f2dd-d4f2-e7ea627e2bc3@eastlink.ca> <1522604036.2902094.1322956328.767274EF@webmail.messagingengine.com> <20180404181017.lcz74c4tyojz77ao@tarpaulin.shahaf.local2> From: Bart Schaefer Date: Wed, 4 Apr 2018 17:20:27 -0700 Message-ID: Subject: Re: whence (was Re: local unfunction) To: Daniel Shahaf Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" On Wed, Apr 4, 2018 at 11:10 AM, Daniel Shahaf wrote: > > Let me rephrase. In your example: > >> > > % path=(./Src $path) >> > > % whence zsh >> > > ./Src/zsh >> > > % whence -a zsh >> > > ./Src/zsh >> > > /bin/zsh >> > > % whence -m zsh >> > > /bin/zsh >> > > % > > why do 'whence' and 'whence -m' give different results? Isn't one or the other > wrong? It could be argued that "whence -m" is inaccurate, yes, but that's because "." and other relative locations in $PATH are weird, not because the command hash table is out of date. It's important to note that "whence -m" is doing pattern matching on strings, not filename generation. It's not meant to search for files in $PATH, it's meant to do "hash -m ..." for all possible command-position hash tables in one go. Most of what else it does, it does because somebody complained that every line of output wasn't uniformly formatted.