Find File List

From EggeWiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Create a list of files which contain a pattern

<geshi lang="bash"> $ SEARCH=SomePattern $ find . -name "*.java" | xargs grep $SEARCH | cut -d: -f1 | sort | uniq | tr '\n' ' ' ./src/MyFile.java ./test/MyFileUnitTest.java </geshi>

These files can then be used as arguments for cvs diff, cvs commit, etc.. Initially I tried using sed to join the lines together, but then I remembered the handy tr command.