I can do this:
$ grep 'text' foo/* foo/**/*
but the problem with that is that it expands to list all the files AND directories, so I get a bunch of these errors:
grep: foo/a: Is a directory
grep: foo/bar/b: Is a directory
grep: foo/bar/c: Is a directory
grep: foo/bar/c/d: Is a directory
So my question is, is there a globstar pattern I can use to only match files?
Note that some directories can contain .
and some files may not have an extension, so **/*.*
doesn't work.
Also, this question is specifically about the ZSH globstar patterns, and not about other solutions, such as:
find foo -type f -exec grep -l "text" {} \;
or
grep -r 'text' foo