Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rochester!pt.cs.cmu.edu!cadre!pitt!darth!investor!rbp From: rbp@investor.UUCP (Bob Peirce) Newsgroups: net.unix Subject: Re: A question concerning diff Message-ID: <791@investor.UUCP> Date: Sun, 7-Sep-86 15:30:46 EDT Article-I.D.: investor.791 Posted: Sun Sep 7 15:30:46 1986 Date-Received: Tue, 9-Sep-86 02:23:08 EDT References: <194@wolf.UUCP> <790@investor.UUCP> Organization: Cookson, Peirce & Co., Pittsburgh, PA Lines: 28 > > Is there a program, command, anything, that will take two files > > { > > 1. An old text file > > 2. A "diff" format file > > } > > and make the changes listed in #2 on #1 and create file #3, the new text file? > > The Sys III manual for diff(1) claims that diff -e file1 file2 will > produce "a script of a, c and d commands for the editor ed, which will > recreate file2 from file1." > > I haven't tried it, but I assume something like the following might work. > > ed file1 < diffs > file2 > > Bob Peirce, Pittsburgh, PA Bad assumption. The manual also gives the solution. (cat diffs; echo '1,$p') | ed - file1 > file2 -- Bob Peirce, Pittsburgh, PA uucp: ...!{allegra, bellcore, cadre, idis} !pitt!darth!investor!rbp 412-471-5320 NOTE: Mail must be < 30K bytes/message