GNU Info

Info Node: (diff.info)ed Scripts

(diff.info)ed Scripts


Next: Forward ed Up: Scripts
Enter node , (file) or (file)node

`ed' Scripts
------------

   `diff' can produce commands that direct the `ed' text editor to
change the first file into the second file.  Long ago, this was the
only output mode that was suitable for editing one file into another
automatically; today, with `patch', it is almost obsolete.  Use the
`-e' or `--ed' option to select this output format.

   Like the normal format (Note: Normal), this output format does not
show any context; unlike the normal format, it does not include the
information necessary to apply the diff in reverse (to produce the first
file if all you have is the second file and the diff).

   If the file `d' contains the output of `diff -e old new', then the
command `(cat d && echo w) | ed - old' edits `old' to make it a copy of
`new'.  More generally, if `d1', `d2', ..., `dN' contain the outputs of
`diff -e old new1', `diff -e new1 new2', ..., `diff -e newN-1 newN',
respectively, then the command `(cat d1 d2 ... dN && echo w) | ed -
old' edits `old' to make it a copy of `newN'.

Detailed ed
A detailed description of `ed' format.
Example ed
A sample `ed' script.

automatically generated by info2www version 1.2.2.9