Jeffrey Holle | 15 Jan 2004 01:19
Picon

encapulating a find function in a script

I'm having a problem with a simple script I'm trying to develop.

Its name is fgrep and its text is:

	#!/bin/bash
	find $1 -name $2 -exec grep -H $3 '{}' ';'

I want to use it like "dgrep 'directory' 'file pattern' 'match text'.

It doesn't match anything because of the $2 parameter.  If I replace 
"$2" with "*.cpp", it works.

Can anybody tell me what is wrong and how to fix it?

-
To unsubscribe from this list: send the line "unsubscribe linux-console" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane