Unix |
Unix v6 |
|
 |
diff(1) |
 |
diff differential file comparator [ ] name1 name2 tells
what lines must be changed in two files to bring them into
agreement. The normal output contains lines of these forms:
a
d
c These lines resemble commands to convert file into file
The numbers after the letters pertain to file In fact, by
exchanging ‘a’ for ‘d’ and reading
backward one may ascertain equally how to convert file into
As in identical pairs where = or = are abbreviated as a
single number. Following each of these lines come all the
lines that are affected in the first file flagged by
‘*’, then all the lines that are affected in the
second file flagged by ‘.’. Under the
option, the output of is a script of and commands for the
editor which will change the contents of the first file into
the contents of the second. In this connection, the
following shell program may help maintain multiple versions
of a file. Only an ancestral file ($1) and a chain of
version-to-version scripts ($2,$3,...) made by need be on
hand. A ‘latest version’ appears on the standard
output. (cat $2 ... $9; echo "1,$p") ed $1 Except
for occasional ‘jackpots’, finds a smallest
sufficient set of file differences. cmp (I), comm (I), ed
(I) ‘jackpot’ To speed things up, the program
uses hashing. You have stumbled on a case where there is a
chance that this has resulted in a difference being called
where none actually existed. Sometimes reversing the order
of files will make a jackpot go away. Editing scripts
produced under the
option are naive about creating lines consisting of a single
‘.’.
 |
diff(1) |
 |