From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3618 invoked by alias); 16 Mar 2012 03:35:42 -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: 16894 Received: (qmail 28166 invoked from network); 16 Mar 2012 03:35:11 -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 autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at benizi.com designates 64.130.10.15 as permitted sender) Date: Thu, 15 Mar 2012 23:28:12 -0400 (EDT) From: "Benjamin R. Haskell" To: Kyle Partridge cc: Nomen Nescio , zsh-users@zsh.org Subject: Re: Why is this happening in zsh? In-Reply-To: Message-ID: References: <8982dc10f425e9b329d9c257cc586c62@dizum.com> User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463810530-84350046-1331848409=:18133" Content-ID: ---1463810530-84350046-1331848409=:18133 Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT Content-ID: On Thu, 15 Mar 2012, Kyle Partridge wrote: > So I alias these type of commands to use `noglob`. Does this solution make sense? > > Ex: > alias find="noglob find" Usually, yes. `find` is a bit different (for me at least), since I often want to do things like: find ~gems/*3.2.0*(/) -exec grep -l some_method '{}' \; (Not the best example, but the point is that I often glob to get the list of directories, and don't want to have to do it using `find` predicates.) I've been using this function that PWS gave me¹: alias find='noglob find' 'find'() { integer i=${argv[(i)-*]} command find ${~argv[1,i-1]} "${(@)argv[i,-1]}" } The alias turns on `noglob`, but then the function manually globs every argument prior to the first one that starts with a dash. -- Best, Ben ¹: zsh-users 15446 : http://www.zsh.org/mla/users/2010/msg00745.html ---1463810530-84350046-1331848409=:18133--