From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23156 invoked from network); 19 Oct 2005 06:25:35 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 19 Oct 2005 06:25:35 -0000 Received: (qmail 6757 invoked from network); 19 Oct 2005 06:25:29 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Oct 2005 06:25:29 -0000 Received: (qmail 11512 invoked by alias); 19 Oct 2005 06:25:21 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9522 Received: (qmail 11500 invoked from network); 19 Oct 2005 06:25:20 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 19 Oct 2005 06:25:20 -0000 Received: (qmail 5659 invoked from network); 19 Oct 2005 06:25:20 -0000 Received: from vms048pub.verizon.net (206.46.252.48) by a.mx.sunsite.dk with SMTP; 19 Oct 2005 06:25:18 -0000 Received: from candle.brasslantern.com ([71.116.81.225]) by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IOL00CKPGI55HC3@vms048.mailsrvcs.net> for zsh-users@sunsite.dk; Wed, 19 Oct 2005 01:25:18 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j9J6PGG7000772 for ; Tue, 18 Oct 2005 23:25:16 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j9J6PGCh000771 for zsh-users@sunsite.dk; Tue, 18 Oct 2005 23:25:16 -0700 Date: Wed, 19 Oct 2005 06:25:15 +0000 From: Bart Schaefer Subject: Re: Trouble with zmv and extended globs In-reply-to: <200510181927.25831.dan.zsh@bullok.com> To: Zsh Users Message-id: <1051019062516.ZM770@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <200510181927.25831.dan.zsh@bullok.com> Comments: In reply to Dan Bullok "Trouble with zmv and extended globs" (Oct 18, 7:27pm) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) 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.0.4 On Oct 18, 7:27pm, Dan Bullok wrote: } varying depths, I try: } zmv -n '(**/con*)(#qe,file ${REPLY}|grep "python script",)' '$1.py' } which gives me the following error: } zmv:238: bad pattern: (*/*)(#qe,file ${REPLY}|grep python,) Philippe's answer was almost the correct one. ** is not a shortcut for (*/)#. **/ is a shortcut for (*/)#. The slash must be there, and must immediately follow the two stars, and there must not be anything but a slash [or open paren] preceding the two stars, or they do not have special meaning (and are the same as one star). In fact, Philippe's second example should work: zmv -n '(*/)#(con*)(#qe,file ${REPLY}|grep "python script",)' '$1$2.py' As should: zmv -n '(**/)(con*)(#qe,file $REPLY | grep "python script",)' '$1$2.py' You might want to use "grep -q", though.