home *** CD-ROM | disk | FTP | other *** search
- #! /bin/csh -xv
- #
- # treegrep fgrep a string through an entire directory tree.
- #
- # Synopsis:
- # treegrep <dir> <str> <file-spec>
- #
- # Where:
- # <dir> is the top directory to start in.
- # <str> is the string to grep for.
- # <file-spec> is the file specification to grep through. Note that
- # wild cards must be escaped.
- #--------------------------------------------------------------------------
-
- set dir = $1
- set str = $2
- set file = $3
-
- find $dir -name $file -exec fgrep $str {} \; -exec echo "\c" \; \
- -print -exec echo "" \;
-