The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 09-14-2007
Unbeliever Unbeliever is offline
Registered User
  
 

Join Date: Jul 2005
Location: England
Posts: 183
you could do it something like this.

Firs create a script called, say mygrep, and put in it:


Code:
#!/bin/sh
grep -nf test.txt "$1" | sed -e "s!^!$1:!"

The you can do this:


Code:
find . -type f -name \*.java -exec ./mygrep {} \;