If you're on Unix/Linux/OS X et al, you could use sed, e.g.
more file | sed 's|Type foo = Object (bar)|Type Tfoo = Class (Tbar)|' > newfile
You'll need to nest this in a loop.
In csh it'd be something like:
foreach file (*.pas) ... end
I think in bash you'd be after:
for file in *.pas do ... done
Hope this is enough to get you started -- good luck.
I have my own small script to deal with filename expansion which avoids shell limits on the number of parameters, etc., which is why I forget exactly how the filename expansion loop things work.
Grant
Hi
This isn't strictly a GPC question, but it is related, so I'll ask anyway :|
Is there an easy way to change a string in all source files to another string?
For example, if I want to change all occurrences of "Type foo = Object (bar)" to "Type Tfoo = Class (Tbar)" in all ".pas" and ".pp" files in a directory tree, is there an easy way to do it, using standard GNU tools? I could of course write a program to do it, but I figured there could be an easier way. Thanks.
Best regards, The Chief
Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/