cramer@optilink.UUCP (Clayton Cramer) (03/26/88)
Surprise, surprise, EDLIN is actually useful for something.
I wanted to replace all occurrences of the string "stdmacro.h" with
"stddef.h" in a number of files. It turns out EDLIN will read commands
from stdin. So I built a batch file that looked like this:
for %%i in (*.c *.h) do edlin %%i <temp2
And temp2 contained:
rstdmacro.h^Zstddef.h
e
which replaced all the occurrences and exited, saving the file.
Admittedly, not as nice as sed, but everyone has EDLIN. With some
cleverness, you might be able to do a variety of types of replace with
this approach.
Clayton E. Cramer