From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 269 invoked by alias); 11 Nov 2014 16:55:13 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33677 Received: (qmail 5827 invoked from network); 11 Nov 2014 16:55:10 -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=Qyz5EhwEgno+0ygJy6JQjg==:117 a=Qyz5EhwEgno+0ygJy6JQjg==:17 a=G8GL833Es-AA:10 a=N659UExz7-8A:10 a=x5biKq25MheragulmuMA:9 a=pILNOxqGKmIA:10 Message-id: <54623EBF.8040308@eastlink.ca> Date: Tue, 11 Nov 2014 08:52:15 -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-workers@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> <20141106211017.11b8848a@pws-pc.ntlworld.com> <20141108204123.1fcc698e@pws-pc.ntlworld.com> <141109105139.ZM27532@torch.brasslantern.com> In-reply-to: <141109105139.ZM27532@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit Got that patch. It works as advertised but I noticed this: $ whence -vam "zsh*" << QUOTED zsh is an alias for /usr/local/bin/zsh zshh is an alias for /usr/local/bin/zsh << CATCHES ALIAS zsh-RayStyle1 is a shell function << CATCHES FUNCTION zshh is a shell function << CATCHES FUNCTION zshh is /usr/local/bin/zshh << CATCHES SCRIPT zsh is /usr/local/bin/zsh zsh-RayStyle1 is /usr/local/bin/zsh-RayStyle1 << CATCHES BINARY zsh is /usr/bin/zsh zsh is /bin/zsh $ whence -vam zsh* << UNQUOTED zsh is an alias for /usr/local/bin/zsh ? zshh ... << MISSES ALIAS ? zshh ... << MISSES FUNCTION ? zshh ... << MISSES SCRIPT zsh is /usr/local/bin/zsh zsh is /usr/bin/zsh zsh is /bin/zsh zsh-RayStyle1 is a shell function << CATCHES FUNCTION zsh-RayStyle1 is /usr/local/bin/zsh-RayStyle1 << CATCHES BINARY I know that '-m' arguments are supposta be quoted, but, apart from the above, I haven't found any situation where it seems to make any difference. Why would it miss 'zshh' but find 'zsh-RayStyle1', and why do the quotation marks change the order? binary 'zsh-RayStyle1' might be found in both cases because it's linked: lrwxrwxrwx 1 28 2014-11-10//13:39:57 zsh -> /usr/local/bin/zsh-RayStyle1* ... but it still seems strange. And the situation with the aliases and functions is hard to understand. Both functions just echo their own name, so it's not the contents. For now the moral of the story is to always quote, but why would one ever *not* quote? I mean is there some valid use of it unquoted, or is that just always wrong? If always wrong, they can we 'autoquote' some how? Complicated! And there's always another gotcha. The above is not rigorous, but any clarification is welcome.