|
|
coherent
diff Command diff
Summarize differences between two files
ddiiffff [-bbddeeffhh] [-cc _s_y_m_b_o_l] _f_i_l_e_1 _f_i_l_e_2
diff compares file1 with file2, and prints a summary of the chan-
ges needed to turn file1 into file2.
Two options involve input file specification. First, the stan-
dard input may be specified in place of a file by entering a
hyphen `-' in place of file1 or file2. Second, if file1 is a
directory, diff looks within that directory for a file that has
the same name as file2, then compares file2 with the file of the
same name in directory file1.
The default output script has lines in the following format:
1,2 c 3,4
The numbers 1,2 refer to line ranges in file1, and 3,4 to ranges
in file2. The range is abbreviated to a single number if the
first number is the same as the second. The command c was chosen
from among the ed commands `aa', `cc', and `dd'. diff then prints
the text from each of the two files. Text associated with file1
is preceded by `< ', whereas text associated with file2 is
preceded by `>'.
The following summarizes diff's options.
-bb Ignore trailing blanks and treat more than one blank in an in-
put line as a single blank. Spaces and tabs are considered to
be blanks for this comparison.
-cc _s_y_m_b_o_l
Produce output suitable for the C preprocessor cpp; the output
contains #iiffddeeff, #iiffnnddeeff, #eellssee, and #eennddiiff lines. symbol is
the string used to build the #ifdef statements. If you define
symbol to the C preprocessor cpp, it will produce file2 as its
output; otherwise, it will produce file1. This option does
_n_o_t work for files that already contain #iiffddeeff, #iiffnnddeeff,
#eellssee, and #eennddiiff statements.
-ee Create an ed script that will convert file1 into file2.
-ff Produce a script in the same manner as the -e option, but with
line numbers taken directly from the two input files. This
will work properly only if applied from end to beginning; it
cannot be used directly by ed.
-hh Compare large files that have a minimal number of differences.
This option uses an algorithm that is not limited by file
length, but may not discover all differences.
COHERENT Lexicon Page 1
diff Command diff
-dd Select the -h algorithm only for files larger than 25,000
bytes; otherwise, use the normal algorithm.
***** See Also *****
ed, egrep, commands
***** Diagnostics *****
diff's exit status is zero when the files are identical, one when
they are different, and two if a problem was encountered (e.g.,
could not open a file).
***** Notes *****
diff cannot handle files with more than 32,000 lines. Handing
diff a file that exceeds that limit will cause it to fail, with
unpredictable side effects.
COHERENT Lexicon Page 2
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.