home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource3
/
134_01
/
diff.nro
< prev
next >
Wrap
Text File
|
1985-08-21
|
4KB
|
118 lines
.so AN.NRO
.TH DIFF 1 "File comparator
.SH NAME
diff -- File comparator
.SH SYNOPSIS
.bo
diff <file1> <file2> <options>
.sp
Options:
.sp
-Alterations | -Match
.br
-Resynch <n>
.br
-Header "foo"
.br
-Blanks
.br
-Singlecase
.br
-Zdebug
.SH DESCRIPTION
.PP
Diff performs a comparison between two ASCII files, and lists the differences
on the console or to redirected output. The general form of a difference
listing is:
.sp
.nf
.nj
--------------------------------------- <line1>
some lines from the first file
--------------------------------------- <line2>
the corresponding lines from the
second file
.fi
.ju
.PP
Several options are available for changing the way DIFF operates. They are
listed below.
.PP
-Match specifies that, rather than listing the differences as shown above,
lines that are the same in both files are to be listed. The header
line will specify the line numbers in file1 and file2, separated by
a comma.
.PP
-Alters specifies that the changed lines in file2 are to be listed. The
format of the listing is:
.sp
.nf
.nj
--------------------------------- <line1>
some lines inserted in second file
--------------------------------- <line2>, <line3>
some lines in second file replacing
lines from the first file.
.fi
.ju
.sp
The first header indicates that the lines which follow are inserted before
line #<line1> in the first file; the second shows that the following lines
replace <line2> through <line3> in the first file.
.PP
-Resynch <n> specifies that at least <n> matching lines are required for
DIFF to end a set of differing lines. The default is 3.
.PP
-Header "foo" says that "foo" is the string to print at the beginning of
a header line. The default is a string of dashes.
.PP
-Blank causes DIFF to treat all strings of blanks and tabs as if they
were single blanks, and to ignore trailing blanks and tabs on lines.
It is useful if two files have things aligned in different columns, but
are otherwise similar.
.PP
-Singlecase causes DIFF to treat lowercase characters the same as their
uppercase equivalents. By default, DIFF respects case differences.
.PP
-Zdebug is used to debug DIFF; it causes a trace of the resynchronization
loop to be printed. It isn't particularly useful.
.PP
Any option may be abbreviated to its first character.
.SH EXAMPLES
.nf
.nj
diff whosis.bak whosis.c
diff -match myfile herfile >duplines
diff oldfile newfile -single -resync 4
.fi
.ju
.SH DIAGNOSTICS
.PP
"Unknown option" -- An unrecognizable option appears on the command line.
.PP
"-xxx option requires a value" -- The -Resync or -Header option was
specified without giving a value.
.PP
"Files have too many differences to compare." -- The two files had
so many contiguous lines without a match that DIFF ran out of memory.
.PP
"can't happen" -- DIFF detected an internal error condition. This
message should never appear.
.SH BUGS
.PP
Sometimes, DIFF loses its place in the files, and starts reporting some
outrageous group of differences or runs out of memory. If this happens,
the file generally has some group of three or more consecutive lines
that are identical but appear in the middle of a changed area. If so,
a larger value of "-resync" may help.
.PP
Equal lines in the middle of a region of differences are reported as different.
If the comparison doesn't break down, a smaller value of "-resync" may
edit these out.
.SH NOTES
If the files have a large number of differences, DIFF may take quite
a while, apparently without disc activity, to find its place. If you
are expecting a large number of differences, don't worry; this is
normal. If you aren't expecting many differences, make sure that
you're comparing the correct pair of files.
so many contiguous lines without a match