Com MN PG P E B Consultant 3 wrote:
> What type of PATTERN can be used here (i.e. glob, regex, extended regex,
> etc.)?

As you heard this is the wrong list but...

> For example, I want to search recursively below a directory D, but want
> to check
> only files starting with "no" or "uh". How do I do this using --include
> ?

Using find for finding files is best.  Really having grep do directory
processing is a misfeature.

> I tried the following:
> 
>   # glob pattern
>   grep -r --include="{no,uh}*" abc D

If you want bash/csh style file globbing them you can just use bash
directly, for the current directory anyway.

  echo {no,uh}* | xargs grep

>   # extended regexp
>   grep -r --include="(no|uh).*" abc D

For that plain old find is best.

  find D -name 'no*' -o -name 'uh*' | xargs grep

>   # Look at all files
>   grep -r abc D

Try:

  grep -r abc .

Bob


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to