From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 83552873 for ; Tue, 17 Dec 2019 07:31:36 +0000 (UTC) Received: (qmail 19424 invoked by alias); 17 Dec 2019 07:31:29 -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: List-Unsubscribe: X-Seq: 24562 Received: (qmail 14972 invoked by uid 1010); 17 Dec 2019 07:31:29 -0000 X-Qmail-Scanner-Diagnostics: from ny007.relay.arandomserver.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25663. spamassassin: 3.4.2. Clear:RC:0(172.96.188.169):SA:0(-2.0/5.0):. Processed in 4.096527 secs); 17 Dec 2019 07:31:29 -0000 X-Envelope-From: zsh@goots.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _ny-spf.arandomserver.com designates 172.96.188.169 as permitted sender) Subject: Re: Glob and grep To: dana References: <15c62c86-5b55-e248-725f-4ecbfe73822d@goots.org> <18417C9E-0212-4E3C-A301-1BBA35F61051@dana.is> Cc: Zsh Users From: Nick Cross Message-ID: <525f37ee-75b9-7528-f732-a4fe14d79a54@goots.org> Date: Tue, 17 Dec 2019 07:30:44 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <18417C9E-0212-4E3C-A301-1BBA35F61051@dana.is> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-AuthUser: goots@goots.org X-Originating-IP: 172.96.184.4 X-SpamExperts-Domain: ams203.hawkhost.com X-SpamExperts-Username: relay Authentication-Results: arandomserver.com; auth=pass (login) smtp.auth=relay@ams203.hawkhost.com X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.25) X-Recommended-Action: accept X-Filter-ID: Mvzo4OR0dZXEDF/gcnlw0c2Pj46HODYmpAMVAv0J1pOpSDasLI4SayDByyq9LIhVXq369+hTm/yf YnFZx49CMkTNWdUk1Ol2OGx3IfrIJKyP9eGNFz9TW9u+Jt8z2T3Kl1t3PxQdgOVB4KO7stALLceq stNyst7L3MBHA7GbaXFe4MbcGNCZyxSFYsGE0YbvbtJYubpbpuSSvGJq3P0uxtfwYErb4UK8xFf9 7EoF4gzZUUis2E8JB1LlIXpAW3FBK571Ms6E3wBhGy+SN+eBABSsp+bUyHifqM2OJ/deOEGh5EJw 3S7WCWE92hxEbY9UTcWsqU26dvDcYIYzaKVPzmqo+CiEiEUieTH4xPDmrp2RMmGH+05pSN4hHKly uAOt+GI6us8zBhGILARURED7AUQMF99VlWOZVo1sbhkkbsX903TmNdO05Y6MiXkIoR870on3OmSH gIFVk16+U330sOTrFXToVyBmRCgQVX6zVyFUu8qzeMQP6uTHL0d9UjfY79efSlj/BZbvF8RtPA8c iETu4cUo7RgAg2CL6KmOVc8nWgAofHWoeO84ZebpAH6aTplPMI8qwV+3DFuSDk5MQkFJkPEV0x2O FYpBGzXLrfiOX8hMONqGCFcXC57PHw7UeuVGCrrjP2eIOSAv5JrzRhLsg6xLmklNmXmDghHXmvUH mFDqewO9xyOqCYO8P1aHaE+VuF51f9AzqvdLkIV9WchJGcAznzaLXBnnVAyhneXpps7IqUuzGzw/ gJPcUS4bgLTV+Wxyj9UY/fc2H1kWFILUAj1reKtuJ/PKbNBhf4+2lgFrv0y39n//jibfmH2hoCnI XpuYLzUVdE71rYtqTZ6Nre5d4tK3KANJBTN2C752GMc/qUo9WwfLYBKomrMNbQC5erRPXvCgmjdq 8p4AMshAcVCOBpo0m57/rV2UEW5OP34VGRo5L8M2MA2Zvy07y8ix1SLPVzvitSzaWxZvnByeP3kM F/HM2qi7bXBmBn805g8jPjKcxrullDiGL8cabRs2U1rduhI6dRoin2mZXvrrDzYxDCjLBSI+Wdjj lCc= X-Report-Abuse-To: spam@se001.arandomserver.com On 16/12/2019 23:18, dana wrote: > On 16 Dec 2019, at 16:44, Nick Cross wrote: >> While I found information about ^(xxx) it wasn't clear how to have multiple >> expressions to ignore. > > In addition to Mikael's suggestion you can also use the x~y syntax, which i > personally find less confusing, and is effectively `m/x/ && !m/y/` in Perl: > > **/*.groovy~*/(test|target)/* > # or you can chain multiple y patterns > **/*.groovy~*/test/*~*/target/* > > (Note that, like zshexpn(1) says, / and . are not special in the y pattern) > > On 16 Dec 2019, at 16:44, Nick Cross wrote: >> Am I right in thinking I can add (.) to e.g. *.groovy to ensure I only >> search for files as well ? > > Use (-.) if you also want to match symlinks to files (which is common) > > dana > Firstly, thanks everyone for the replies. The '~' syntax is interesting; so effectively the negated options are put at the end. Nick