From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8548 invoked from network); 6 Sep 2009 21:29:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 6 Sep 2009 21:29:48 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 95833 invoked from network); 6 Sep 2009 21:29:44 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Sep 2009 21:29:44 -0000 Received: (qmail 7769 invoked by alias); 6 Sep 2009 21:29:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27249 Received: (qmail 7751 invoked from network); 6 Sep 2009 21:29:40 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 6 Sep 2009 21:29:40 -0000 Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by bifrost.dotsrc.org (Postfix) with ESMTP id 26A79801E2BF for ; Sun, 6 Sep 2009 23:29:34 +0200 (CEST) Received: by bwz17 with SMTP id 17so1597517bwz.45 for ; Sun, 06 Sep 2009 14:29:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=DUcK1IrKEvUWNT9U480ohdPn26Z4smTyYvNaDvSZZ78=; b=c6PzZElUvo0pazoEuhwyQlSAu4KuN7BHizUIN823nCFXukPnYpgdi63sHBf55oMgy3 Zvc/M3Hc9xqgRREpTxHh+4ELGWAUqAJOO1NFZZScO6rIpJcGfDVYA6KPBl8wlmxl6jXm FHfM8MzWNv5Kg8+xCps/WeEe7yGq3sTeMw0ak= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Tw//YpD433+Ux6w5plym1ImDxt+/2vq5OpzufP5GMB++uDvOAr8onMHJjapPrtkd8w nQd2gf+wsNnASARj4JU9ReSxlDFB+5Z+zb4IVtsKU+mnPxFLHAPJPO5p1RVKCQ/7ztQH ZRx3Kz9gT5Vcr7X4dqpp2Gcdqkt33BHE/1Rhg= MIME-Version: 1.0 Received: by 10.204.34.18 with SMTP id j18mr11528416bkd.38.1252272573847; Sun, 06 Sep 2009 14:29:33 -0700 (PDT) In-Reply-To: <20090906194821.73936211@pws-pc> References: <237967ef0909051629x73f79a43v49d9baa573c5b19@mail.gmail.com> <20090906194821.73936211@pws-pc> Date: Sun, 6 Sep 2009 23:29:33 +0200 Message-ID: <237967ef0909061429q4f2c3bc1r4d67d0b522a7543b@mail.gmail.com> Subject: Re: zmv -W/-w in subdirs, possibly patch From: Mikael Magnusson To: zsh-workers Content-Type: text/plain; charset=UTF-8 X-Virus-Scanned: ClamAV 0.94.2/9779/Sun Sep 6 11:41:03 2009 on bifrost X-Virus-Status: Clean 2009/9/6 Peter Stephenson : > On Sun, 6 Sep 2009 01:29:50 +0200 > Mikael Magnusson wrote: >> My question is: Why was the / there in the first place? Would the >> above patch break any existing usecases? >> (in case it is hard to spot, the patch removes the only / on the >> line). If it does break some weird complex >> pattern, maybe I would argue that you should not use -w then. > > I've a suspicion this was supposed to catch **/. This might even work. > > Index: Functions/Misc/zmv > =================================================================== > RCS file: /cvsroot/zsh/zsh/Functions/Misc/zmv,v > retrieving revision 1.14 > diff -u -r1.14 zmv > --- Functions/Misc/zmv 11 May 2008 11:23:31 -0000 1.14 > +++ Functions/Misc/zmv 6 Sep 2009 18:44:18 -0000 > @@ -187,7 +187,7 @@ > # Well, this seems to work. > # The tricky bit is getting all forms of [...] correct, but as long > # as we require inactive bits to be backslashed its not so bad. > - find='(#m)((\*\*#/|[*?]|<[0-9]#-[0-9]#>|\[(^|)(\]|)(\[:[a-z]##:\]|\\?|[^\]])##\])\##|?\###)' > + find='(#m)((\*\*##/|[*?]|<[0-9]#-[0-9]#>|\[(^|)(\]|)(\[:[a-z]##:\]|\\?|[^\]])##\])\##|?\###)' > tmp="${pat//${~find}/$[++cnt]}" > if [[ $cnt = 0 ]]; then > print -r -- "$myname: warning: no wildcards were found in search pattern" >&2 Your version works with *.foo, */*.foo and **/*.foo, I didn't try any other variations. -- Mikael Magnusson