#!/bin/csh # Text search by Doug Letterman # 2001-02-09 # This does a simple text search # it takes two arguments: ts.csh "search string" "files" if ($#argv < 2 || $#argv > 2) then ## wrong number of args ##explain the usage echo 'text search usage: '$0' searchString "files"' exit 1 ## exit with an error endif set files = (`find . -name "$2"`); while ($#files > 0) set test = `grep -c ''$1'' $files[1]` if ($test > 0) then echo "$files[1]" endif shift files; end # while exit 0;