> -> ... All I want to do is search all the *.c file
> -> recursively starting from a specific directory for a specific string...
> -> grep -r -e "function something" -f *.c
> I'd start with:
> grep -i "function" *.c

The above will search all .c files in the current directory, but will
not descend the tree. Using -r will not likely help, since the shell
will expand the "*.c" in the current directory before grep ever sees the
command line.

I usually use something like:

find . -name '*.c' -exec egrep 'regexp' {} \; -print

where the "-print" will show you which file had the matching string(s).

                             - Tom

-- 
Thomas Lockhart
Caltech/JPL
Interferometry Systems and Technology

Reply via email to