I had a bit of trouble with find. This didn't do what I expected:
find . -iname "*.hh" -or -iname "*.h" -exec grep -inH "IDENTIFIER" {} \; I expected it to grep in both *.hh and *.h files but it only greps the result of -iname "*.h". I resorted to using xargs to solve it.
find . -iname "*.hh" -or -iname "*.h" | xargs grep -inH "IDENTIFIER" But is there a way to use -exec without writing it twice like this:
find . -iname "*.hh" -exec grep -inH "IDENTIFIER" {} \; -or -iname "*.h" -exec grep -inH "IDENTIFIER" {} \;