I want to diff two files to generate a third file that contains edits. This
third file of edits I can then apply to the first file to convert it into
the seconf file by running it through either sed or ed.


You want diff for the first part, and patch for the second part.

You shouldn't need patch. The man page for diff says the -e option will produce a script of commands that can be passed to ed. Going from the example in the man page, this is how you do it:

Generate the ed script:

   diff -e xx yy > diffs

Generate file yy from the diffs and xx:

   ( cat diffs ; echo '1,$p' ) | ed - xx

Ashley.

--
Ashley Sanders [EMAIL PROTECTED]
Copac http://copac.ac.uk -- A MIMAS service funded by JISC

Reply via email to