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 7a6cd4d5 for ; Tue, 17 Dec 2019 10:01:20 +0000 (UTC) Received: (qmail 353 invoked by alias); 17 Dec 2019 10:01:13 -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: 24566 Received: (qmail 1119 invoked by uid 1010); 17 Dec 2019 10:01:13 -0000 X-Qmail-Scanner-Diagnostics: from 195-159-176-226.customer.powertech.no 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(195.159.176.226):SA:0(-0.3/5.0):. Processed in 4.003664 secs); 17 Dec 2019 10:01:13 -0000 X-Envelope-From: gcszu-zsh-users@m.gmane.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at m.gmane.org does not designate permitted sender hosts) X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: zzapper Subject: Re: Glob and grep Date: Tue, 17 Dec 2019 10:00:22 -0000 (UTC) Organization: Your Company Message-ID: References: <15c62c86-5b55-e248-725f-4ecbfe73822d@goots.org> User-Agent: Xnews/2009.05.01 X-Antivirus: Avast (VPS 191216-0, 16/12/2019), Outbound message X-Antivirus-Status: Clean Nick Cross wrote in news:15c62c86-5b55-e248-725f- 4ecbfe73822d@goots.org: > > Hi, > > While I've been able to find varying amounts of information on the net I > haven't found quite enough to get the following working. > > I would like to condense the following into a single grep / glob > expression where I search recursively through a directory tree, ignoring > any sub-trees starting with 'test' or 'target'. > > grep **/*.groovy | egrep -v "(/test/|/target/)" # zargs cope with large hierarchy autoload zargs zargs **/*.(js|php|css|inc)~(|libs|test|temp|node*|dump)/*~*/junk/* -- grep -i 2>/dev/null searchstr # alias which I tab expand then adjust as required alias zg='zargs **/*.(php|inc|js)~(libs|test|temp|wiki|dompdf)/* -- grep -i ' -- zzapper https://twitter.com/dailyzshtip