And Then She Sed What?
This is why I need a good development IDE like Eclipse; however, I work for the government and am left only with my faithful-but-cumbersome copy of XEmacs. I need to change the package name for a set of Java classes, which results in a cascade of changes in and out of the package. Argh.
Thankfully, there is 'sed'. Sed is an old-school UNIX tool for performing text substitution with regular expressions. So I drop this little shell script, let it run, and get back to BoingBoing.
for file in `find . -name "*.java" -print`; do mv $file $file.bak; sed 's/oldpackage/newpackage/g' $file.bak > $file; done