> > > find /usr/src -name "*.[c|h]" -exec grep 'bpf.h' /dev/null {} \;
> >                            ^(a) ^^^^^(b)
> >
> > (a) I doubt there are any file names ending in a pipe symbol in /usr/src.
> man ksh
The point being made is that '*.[ch]' is what you want. | does not
mean "or" in a character class in this situation.

> > (b) pipeing to xargs(1) may be faster.
> why?

Because without it find starts a grep process on every found file
individually. Using xargs will execute one grep process on many files
at once:

find /usr/src -name '*.[ch]' | xargs grep -L 'bpf.h'

There is a new + feature in some versions of find that precludes using
xargs, but I don't think it's in OpenBSD's find.

Reply via email to