I think this one-liner should have done the trick:

find . -name '*.java' | xargs perl -pi.bak -e 'BEGIN { $newAuthor = "<a
href=mailto:[EMAIL PROTECTED]>Apache Avalon Development
Team</a>"; $a="\@
author"; } s/$a.*$/$a $newAuthor/g if (m/$a/ && (++$c == 1));'

it finds all docs ending with .java in all subdirectories of '.' and appends
the names (via xargs) to perl. perl opens each file and loops through it,
always printing out the current line after each loop (-p). -i renames each
file to .bak and prints the results back to the original file. The last "if"
takes care that only the first occurence is replaced (although i don't see
why others shouldn't).

Sometimes Perl can be more efficient than Java.....

Clemens


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to