Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Glob and grep
- X-seq: zsh-users 24557
- From: Nick Cross <zsh@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Glob and grep
- Date: Mon, 16 Dec 2019 22:44:50 +0000
- Authentication-results: arandomserver.com; auth=pass (login) smtp.auth=relay@xxxxxxxxxxxxxxxxxxx
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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/)"
While I found information about ^(xxx) it wasn't clear how to have
multiple expressions to ignore.
Am I right in thinking I can add (.) to e.g. *.groovy to ensure I only
search for files as well ?
Thanks
Nick
Messages sorted by:
Reverse Date,
Date,
Thread,
Author