zsh-users
 help / color / mirror / code / Atom feed
From: zzapper <david@rayninfo.co.uk>
To: zsh-users@zsh.org
Subject: Re: Glob and grep
Date: Tue, 17 Dec 2019 10:00:22 -0000 (UTC)	[thread overview]
Message-ID: <XnsAB2865CAAB385davidrayninfocouk@195.159.176.226> (raw)
In-Reply-To: <15c62c86-5b55-e248-725f-4ecbfe73822d@goots.org>

Nick Cross <zsh@goots.org> 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 <pattern> **/*.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


      parent reply	other threads:[~2019-12-17 10:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16 22:44 Nick Cross
2019-12-16 23:10 ` Mikael Magnusson
2019-12-16 23:24   ` Dominik Vogt
2019-12-17  1:20     ` Daniel Shahaf
2019-12-17  7:31       ` Nick Cross
2019-12-17  7:31   ` Nick Cross
2019-12-17  9:39     ` Mikael Magnusson
2019-12-16 23:18 ` dana
2019-12-17  7:30   ` Nick Cross
2019-12-17 10:00 ` zzapper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=XnsAB2865CAAB385davidrayninfocouk@195.159.176.226 \
    --to=david@rayninfo.co.uk \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).