From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116 invoked from network); 5 Sep 2009 23:30:20 -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; 5 Sep 2009 23:30:20 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 36068 invoked from network); 5 Sep 2009 23:30:07 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Sep 2009 23:30:07 -0000 Received: (qmail 8227 invoked by alias); 5 Sep 2009 23:29:58 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27246 Received: (qmail 8202 invoked from network); 5 Sep 2009 23:29:57 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 5 Sep 2009 23:29:57 -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 D12A0801E2BF for ; Sun, 6 Sep 2009 01:29:51 +0200 (CEST) Received: by bwz17 with SMTP id 17so1297497bwz.45 for ; Sat, 05 Sep 2009 16:29:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=jN9IYONOpPaEpbTyfnvPB+n6lEp5Mp43UVTpn5iOI64=; b=UKR6zta9Tw8Qcf+YuGq7lERTsKkfVcyTWfnMwC/llxfx4rbVuo48SU8Cv+/x2fKJRs Yob6zArROuikFopwEWM5ZwmluPD8hb4vWZ4SCvuGuuapajnpn8cIxcA1nbiKtvxlJKlB at2mNBxt2oTyPEpt6kjuX1/zKJLyV7G7z3pOg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=J7i8zR4wdJavjMutX6g0vGIwpZI+CQKFgI8KL308+NQNr6luf0z1ki2JmQsgGg3a46 P/pYoyJBcouhX4ZOpitCFQHNzP6Kjyg20g9XhC8/qtQd+2aK3VjIwZL6/6CP6hVSLKuE xj38BNU70dSNFOXQfNumtCcASEbrY0R7SK28o= MIME-Version: 1.0 Received: by 10.204.7.198 with SMTP id e6mr10592864bke.148.1252193390771; Sat, 05 Sep 2009 16:29:50 -0700 (PDT) Date: Sun, 6 Sep 2009 01:29:50 +0200 Message-ID: <237967ef0909051629x73f79a43v49d9baa573c5b19@mail.gmail.com> Subject: 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/9777/Sat Sep 5 00:17:01 2009 on bifrost X-Virus-Status: Clean Hi, % ren */*.JPG */*.jpg zmv:232: bad pattern: (*/)(*).JPG --- a/Functions/Misc/zmv +++ b/Functions/Misc/zmv @@ -187,7 +187,7 @@ if [[ -n $opt_w || -n $opt_W ]]; then # 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 % ren */*.JPG */*.jpg [the files are renamed successfully] 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. -- Mikael Magnusson