
substituting strings in source trees?
Quote:
>Is there anything about that one can use to take a source tree
>(forget that) just the file since I can qualify which files to do. and
>automatically do string substitutions..
>One that preferably is reliable and creates backup files for every
>file it touches?
>I guess I could hack one of these together but I figure it's already
>been done.
Perl can do 'in place' editing using the -i flag, so you'd want to do
something like:
perl -pi.bak -e 's/foo/bar/g' <list of filenames>
this will leave files with backups with extensions of .bak
Hope this helps,
Mike
--
The "usual disclaimers" apply. | Meiko
Mike Stok | 130C Baker Ave. Ext
Meiko tel: (508) 371 0088 x124 |