I used to use GNU sed, but the BSD version of sed could not edit in place.
Instead of compiling GNU sed for each platform, I found a more portable way to do it using Perl:

Instead of compiling GNU sed for each platform, I found a more portable way to do it using Perl:
perl -pi -w -e 's/search/replace/g;' *.c

Charles Darke | 28 November 2007