
20 Apr
2004
20 Apr
'04
9:05 a.m.
How do I find files having either of several extensions? Eg this finds all .c and .h files $find . -name '*.[ch]' but what if I want to find all .cpp and .h files? I guess I need a grouping operator in the pattern but I can't figure out what it is. I've looked in the man page and Google and tried a few things, also tried the -regex switch instead of -name but couldn't get it to work. Eg this doesn't find anything $find . -regex '.*\.(cpp|h)' I suspect the answer is really simple. Any ideas what I'm doing wrong? g -- Glenn Ramsey <glenn(a)componic.co.nz> 07 8627077 http://www.componic.co.nz