From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16321 invoked by alias); 11 Nov 2014 19:14:29 -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: 33681 Received: (qmail 7697 invoked from network); 11 Nov 2014 19:14:26 -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-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:cc:content-type; bh=TvZ5AZ0h5f9LgautT1vzxIzZLa/6bd9S9eg9S8mu1Bg=; b=QT3f/Z2ZT9U9mN61tUSKX8vRtpLRQ3EgNul8/wjvM+zmP+1ZrIuUV4w932YD0BC+jw Dz+fN76uxXhxb+CSHb/jRpXX/xFwVNUwmwrV/CHo7LLyBayELgqyp7RpLeUmywi9VcW8 miHqdANWCTh+9/0LkHt0bJp1p9bg4zPPIRYb3uF3Zgd2cx28pX9KzZAEzIhLcviYoNzb mCU8KiOcv3xfBdDOUS8/q9kTKIZInnkmE1TqCJoKafbo4dPgRUAn6wfCMBYFQUJYOTPI ob4YTTnD5o95RDiJkUdwWMzJD8RJQ6Hw5pNnWCIwmsLE+x0MCUUnCDbMedaU8fo8nF5r Kv5w== X-Gm-Message-State: ALoCoQkFw6yRNApZAWlgomJTUewzodx/TGm4m9z0sonZPKcfwBVO6aZM1ARWLnjDc+UUXFz0dnl2 MIME-Version: 1.0 X-Received: by 10.194.3.2 with SMTP id 2mr56721694wjy.89.1415733259868; Tue, 11 Nov 2014 11:14:19 -0800 (PST) In-Reply-To: <54623EBF.8040308@eastlink.ca> 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> <54623EBF.8040308@eastlink.ca> Date: Tue, 11 Nov 2014 11:14:19 -0800 Message-ID: Subject: Re: 'whence' question From: Bart Schaefer To: Ray Andrews Cc: Zsh hackers list Content-Type: text/plain; charset=UTF-8 On Tue, Nov 11, 2014 at 8:52 AM, Ray Andrews wrote: > Got that patch. It works as advertised If you haven't already, you might want to get minimally familiar with "git" so you can pull from the development repository rather than applying individual patches. > but I noticed this: > > $ whence -vam zsh* << UNQUOTED What's happening here is that zsh* is being expanded as a file glob in the local directory, and then "whence" is being called with the resulting file names as arguments and looking up each of them in turn. Try $ echo whence -vam zsh* and see what you get. I think this will explain all your confusion. > For now the moral of the story is to always quote, but why would > one ever *not* quote? For "whence" one probably would always quote patterns. For most other commands that operate on file names, one probably wants them unquoted, so that is the default behavior. Command line input semantics including globbing are entirely separate in *nix from the semantics internal to the command itself -- very unlike DOS where it is up to the command to invoke globbing on its arguments. > 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? You could use alias whence='noglob whence ' (the trailing space is important, see the description of the "alias" command).