MiniUnix/usr/man/man1/diff.1

Find at most related files.
including files from this version of Unix.

.th DIFF I 5/15/74
.sh NAME
diff \*- differential file comparator
.sh SYNOPSIS
.bd diff
[
.bd \*-
] name1 name2
.sh DESCRIPTION
.it Diff
tells what lines must be changed in two files to bring them
into agreement.
The normal output contains lines of these forms:
.s3
.lp +5 0
.it n1
a
.it n3,n4
.br
.it n1,n2
d
.it n3
.br
.it n1,n2
c
.it n3,n4
.s3
.i0
These lines resemble
.it ed
commands to convert file
.it name1
into file
.it name2.
The numbers after the letters pertain to file
.it name2.
In fact, by exchanging `a' for `d' and reading backward
one may ascertain equally how to convert file 
.it name2
into
.it name1.
As in 
.it ed,
identical pairs where
.it n1
=
.it n2
or
.it n3
=
.it n4
are abbreviated as a single number.
.s3
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 `\fB.\fR'.
.s3
Under the \fB\*-\fR option,
the output of
.it diff
is a script of
.it "a, c"
and 
.it d
commands for the editor
.it ed,
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
.it ed
scripts ($2,$3,...) made by
.it diff
need be on hand.
A `latest version' appears on
the standard output.
.s3
.lp +5 0
.tr ||
(cat $2 ... $9; echo "1,$p") \*v ed \*- $1
.s3
.i0
Except for occasional `jackpots',
.it diff
finds a smallest sufficient set of file
differences.
.sh "SEE ALSO"
cmp (I), comm (I), ed (I)
.sh DIAGNOSTICS
`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.
.sh BUGS
Editing scripts produced under the
\fB\*-\fR option are naive about
creating lines consisting of a single `\fB.\fR'.